Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
130fbf83
Commit
130fbf83
authored
5 years ago
by
ThibG
Committed by
Eugen Rochko
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix possible race condition when processing statuses (#10815)
parent
39d1d022
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/activitypub/activity/create.rb
+5
-1
app/lib/activitypub/activity/create.rb
with
5 additions
and
1 deletion
+5
-1
app/lib/activitypub/activity/create.rb
+
5
-
1
View file @
130fbf83
...
...
@@ -267,7 +267,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
def
conversation_from_uri
(
uri
)
return
nil
if
uri
.
nil?
return
Conversation
.
find_by
(
id:
OStatus
::
TagManager
.
instance
.
unique_tag_to_local_id
(
uri
,
'Conversation'
))
if
OStatus
::
TagManager
.
instance
.
local_id?
(
uri
)
Conversation
.
find_by
(
uri:
uri
)
||
Conversation
.
create
(
uri:
uri
)
begin
Conversation
.
find_or_create_by!
(
uri:
uri
)
rescue
ActiveRecord
::
RecordInvalid
,
ActiveRecord
::
RecordNotUnique
retry
end
end
def
visibility_from_audience
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets