Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
f4b7c6b6
Unverified
Commit
f4b7c6b6
authored
3 years ago
by
Eugen Rochko
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix nil error when removing status caused by race condition (#16099)
parent
a6564d56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/status_reach_finder.rb
+1
-1
1 addition, 1 deletion
app/lib/status_reach_finder.rb
app/models/status.rb
+4
-0
4 additions, 0 deletions
app/models/status.rb
app/workers/activitypub/distribution_worker.rb
+1
-1
1 addition, 1 deletion
app/workers/activitypub/distribution_worker.rb
with
6 additions
and
2 deletions
app/lib/status_reach_finder.rb
+
1
−
1
View file @
f4b7c6b6
...
...
@@ -62,7 +62,7 @@ class StatusReachFinder
end
def
followers_inboxes
if
@status
.
reply
?
&&
@status
.
thread
.
account
.
local
?
&&
@status
.
distributable?
if
@status
.
in_
reply
_to_local_
account?
&&
@status
.
distributable?
@status
.
account
.
followers
.
or
(
@status
.
thread
.
account
.
followers
).
inboxes
else
@status
.
account
.
followers
.
inboxes
...
...
This diff is collapsed.
Click to expand it.
app/models/status.rb
+
4
−
0
View file @
f4b7c6b6
...
...
@@ -161,6 +161,10 @@ class Status < ApplicationRecord
attributes
[
'local'
]
||
uri
.
nil?
end
def
in_reply_to_local_account?
reply?
&&
thread
&
.
account
&
.
local?
end
def
reblog?
!
reblog_of_id
.
nil?
end
...
...
This diff is collapsed.
Click to expand it.
app/workers/activitypub/distribution_worker.rb
+
1
−
1
View file @
f4b7c6b6
...
...
@@ -35,7 +35,7 @@ class ActivityPub::DistributionWorker
# Deliver the status to all followers.
# If the status is a reply to another local status, also forward it to that
# status' authors' followers.
@inboxes
||=
if
@status
.
reply
?
&&
@status
.
thread
.
account
.
local
?
&&
@status
.
distributable?
@inboxes
||=
if
@status
.
in_
reply
_to_local_
account?
&&
@status
.
distributable?
@account
.
followers
.
or
(
@status
.
thread
.
account
.
followers
).
inboxes
else
@account
.
followers
.
inboxes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment