fix: guard getInReplyTo call for partial Fedify objects

Some resolved Note objects from Create activities don't have
getInReplyTo as a function (Fedify stub/partial resolution).
Add typeof check and try-catch to prevent inbox processing crash.
This commit is contained in:
Ricardo
2026-02-20 08:22:43 +01:00
parent 84122cc470
commit 473624c709
2 changed files with 9 additions and 5 deletions

View File

@@ -207,10 +207,14 @@ export function registerInboxListeners(inboxChain, options) {
actorObj?.preferredUsername?.toString() ||
actorUrl;
const inReplyTo =
object instanceof Note
? (await object.getInReplyTo())?.id?.href
: null;
let inReplyTo = null;
if (object instanceof Note && typeof object.getInReplyTo === "function") {
try {
inReplyTo = (await object.getInReplyTo())?.id?.href ?? null;
} catch {
/* remote fetch may fail */
}
}
// Log replies to our posts (existing behavior for conversations)
if (inReplyTo) {

View File

@@ -1,6 +1,6 @@
{
"name": "@rmdes/indiekit-endpoint-activitypub",
"version": "1.0.11",
"version": "1.0.12",
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
"keywords": [
"indiekit",