From 4858abe1498a6c75d3f3b7108484d32f7e7439c6 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 29 Oct 2025 15:18:13 -0400 Subject: [PATCH] fix: add replies in parallel during note assertion --- src/activitypub/notes.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index b0efa76e08..0673a99b0d 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -248,18 +248,16 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { } } - for (const post of unprocessed) { + await Promise.all(unprocessed.map(async (post) => { const { to, cc } = post._activitypub; try { - // eslint-disable-next-line no-await-in-loop await topics.reply(post); - // eslint-disable-next-line no-await-in-loop await Notes.updateLocalRecipients(post.pid, { to, cc }); } catch (e) { activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`); } - } + })); await Notes.syncUserInboxes(tid, uid);