fix(activitypub): fix receiving comments

Should fix race conditions and actors deleted of received comments

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-12-05 07:59:06 +01:00
parent 749e90b6c9
commit f1084c101f
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 7 additions and 0 deletions

View File

@ -81,7 +81,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
object_data
|> transform_object_data_for_discussion()
|> save_comment_or_discussion()
{:ok, %Comment{} = comment} ->
# Object already exists
{:ok, nil, comment}
end
{:error, err} ->
{:error, err}
end
{:ok, %Comment{} = comment} ->