From a3c6c872b9e25940c5a8ad30d3ef063a30a43c45 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Jun 2024 13:48:00 -0400 Subject: [PATCH] fix: wrap ap note creation in setImmediate to let internal hooks have a chance to wrap up first --- src/api/topics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/topics.js b/src/api/topics.js index 4b853afebc..21d7111c62 100644 --- a/src/api/topics.js +++ b/src/api/topics.js @@ -82,7 +82,9 @@ topicsAPI.create = async function (caller, data) { socketHelpers.notifyNew(caller.uid, 'newTopic', { posts: [result.postData], topic: result.topicData }); if (!isScheduling) { - activitypubApi.create.note(caller, { pid: result.postData.pid }); + setImmediate(() => { + activitypubApi.create.note(caller, { pid: result.postData.pid }); + }); } return result.topicData;