From 629eec7b5b17c55984dd690b281224d9139a57d4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 30 May 2025 16:49:15 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20add=20try..catch=20wrapper=20around=20An?= =?UTF-8?q?nounce(Like)=20call=20to=20internal=20method=20so=20as=20to=20n?= =?UTF-8?q?ot=20return=20a=20500=20=E2=80=94=20just=20drop=20the=20Like=20?= =?UTF-8?q?activity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/activitypub/inbox.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 0369b11248..9b0f5c6987 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -294,9 +294,13 @@ inbox.announce = async (req) => { const { id: localId } = await activitypub.helpers.resolveLocalId(id); const exists = await posts.exists(localId || id); if (exists) { - const result = await posts.upvote(localId || id, object.actor); - if (localId) { - socketHelpers.upvote(result, 'notifications:upvoted-your-post-in'); + 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. } }