From 9dfccdd713243f6a153247d70cd1f4d5df844d69 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 13 Aug 2020 10:08:38 -0400 Subject: [PATCH] Adding a comment. --- server/src/apub/inbox/activities/create.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/apub/inbox/activities/create.rs b/server/src/apub/inbox/activities/create.rs index 1c9c973eb..238c62f9e 100644 --- a/server/src/apub/inbox/activities/create.rs +++ b/server/src/apub/inbox/activities/create.rs @@ -65,6 +65,8 @@ async fn receive_create_post( let post = PostForm::from_apub(&page, client, pool, Some(user.actor_id()?)).await?; + // Using an upsert, since likes (which fetch the post), sometimes come in before the create + // resulting in double posts. let inserted_post = blocking(pool, move |conn| upsert_post(&post, conn)).await??; // Refetch the view