From a41b7ffff34c1839fb7780f0535b01a80deab6e4 Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 14 Jun 2026 18:12:54 +0200 Subject: [PATCH] fix(patch): re-anchor ap-inbox-mention-self-guard to getTags() line shape The mention-self-guard patch anchored on the old `tag.type === "Mention"` line. The activitypub fork (>= 32ea375) now reads inbound tags via getTags() and matches on tag.constructor.name, so the old anchor no longer matched and a fresh npm install would silently drop the self-guard (warn + continue). Updated oldSnippet/newSnippet to the new line shape; verified both inbox patches (self-create-gate + mention-self-guard) match the current fork source. --- scripts/patch-ap-inbox-self-mention-filter.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/patch-ap-inbox-self-mention-filter.mjs b/scripts/patch-ap-inbox-self-mention-filter.mjs index f966396f..5fe0467b 100644 --- a/scripts/patch-ap-inbox-self-mention-filter.mjs +++ b/scripts/patch-ap-inbox-self-mention-filter.mjs @@ -40,8 +40,10 @@ const patchSpecs = [ { name: "ap-inbox-mention-self-guard", marker: "// [patch] ap-inbox-mention-self-guard", - oldSnippet: ` if (tag.type === "Mention" && tag.href?.href === ourActorUrl) {`, - newSnippet: ` if (tag.type === "Mention" && tag.href?.href === ourActorUrl && actorUrl !== ourActorUrl) { // [patch] ap-inbox-mention-self-guard`, + // Upstream fork (>= 32ea375) reads mention tags via getTags() and matches on + // tag.constructor.name instead of tag.type. Anchor on the new line shape. + oldSnippet: ` if (tag.constructor?.name === "Mention" && tag.href?.href === ourActorUrl) {`, + newSnippet: ` if (tag.constructor?.name === "Mention" && tag.href?.href === ourActorUrl && actorUrl !== ourActorUrl) { // [patch] ap-inbox-mention-self-guard`, }, ];