mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
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:
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user