mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
likePost, unlikePost and boostPost all call resolveAuthor() which makes up to 3 signed HTTP requests to the remote server (post fetch, author actor fetch, getAttributedTo) with no timeout. If the remote server is slow or unreachable, the favourite/reblog HTTP response hangs until the Node.js socket default times out (~2 min). Mastodon clients (Phanpy, Elk) give up much sooner and show "Failed to load post". Fix: wrap every resolveAuthor() call in a Promise.race() with a 5 s timeout. The interaction is still recorded in ap_interactions and the Like/Announce activity is still sent when recipient resolution succeeds within the window; if it times out, AP delivery is silently skipped (the local record is kept — the client sees a successful ⭐). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>