fix: add replies in parallel during note assertion

This commit is contained in:
Julian Lam
2025-10-29 15:18:13 -04:00
parent 748cc5eecd
commit 4858abe149

View File

@@ -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; const { to, cc } = post._activitypub;
try { try {
// eslint-disable-next-line no-await-in-loop
await topics.reply(post); await topics.reply(post);
// eslint-disable-next-line no-await-in-loop
await Notes.updateLocalRecipients(post.pid, { to, cc }); await Notes.updateLocalRecipients(post.pid, { to, cc });
} catch (e) { } catch (e) {
activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`); activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`);
} }
} }));
await Notes.syncUserInboxes(tid, uid); await Notes.syncUserInboxes(tid, uid);