fix: wrap try..catch around topics.reply in note assertion to output errors

This commit is contained in:
Julian Lam
2024-12-11 14:40:21 -05:00
parent 8ec388afca
commit b551abce59

View File

@@ -196,13 +196,17 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
for (const post of unprocessed) { for (const post of unprocessed) {
const { to, cc, attachment } = post._activitypub; const { to, cc, attachment } = post._activitypub;
// eslint-disable-next-line no-await-in-loop try {
await topics.reply(post); // eslint-disable-next-line no-await-in-loop
// eslint-disable-next-line no-await-in-loop await topics.reply(post);
await Promise.all([ // eslint-disable-next-line no-await-in-loop
Notes.updateLocalRecipients(post.pid, { to, cc }), await Promise.all([
posts.attachments.update(post.pid, attachment), Notes.updateLocalRecipients(post.pid, { to, cc }),
]); posts.attachments.update(post.pid, attachment),
]);
} catch (e) {
activitypub.helpers.log(`[activitypub/notes.assert] Could not add reply (${post.pid}): ${e.message}`);
}
} }
await Promise.all([ await Promise.all([