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,6 +196,7 @@ 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;
try {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
await topics.reply(post); await topics.reply(post);
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
@@ -203,6 +204,9 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
Notes.updateLocalRecipients(post.pid, { to, cc }), Notes.updateLocalRecipients(post.pid, { to, cc }),
posts.attachments.update(post.pid, attachment), 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([