fix: add try..catch wrapper around Announce(Like) call to internal method so as to not return a 500 — just drop the Like activity

This commit is contained in:
Julian Lam
2025-05-30 16:49:15 -04:00
parent ebb88c1277
commit 629eec7b5b

View File

@@ -294,10 +294,14 @@ inbox.announce = async (req) => {
const { id: localId } = await activitypub.helpers.resolveLocalId(id);
const exists = await posts.exists(localId || id);
if (exists) {
try {
const result = await posts.upvote(localId || id, object.actor);
if (localId) {
socketHelpers.upvote(result, 'notifications:upvoted-your-post-in');
}
} catch (e) {
// vote denied due to local limitations (frequency, privilege, etc.); noop.
}
}
break;