diff --git a/scripts/patch-webmention-sender-livefetch.mjs b/scripts/patch-webmention-sender-livefetch.mjs index e2339833..40688d9c 100644 --- a/scripts/patch-webmention-sender-livefetch.mjs +++ b/scripts/patch-webmention-sender-livefetch.mjs @@ -99,7 +99,7 @@ const newBlock = ` // [patched:livefetch:v2] Always fetch the live page s // Validate the response is a real post page, not an error/502 page. // extractLinks scopes to .h-entry, so if there's no .h-entry the page // is not a valid post (e.g. nginx 502, login redirect, error template). - if (_html.includes("h-entry")) { + if (_html.includes("h-entry\"") || _html.includes("h-entry ")) { contentToProcess = _html; } else { console.log(\`[webmention] Live page for \${postUrl} has no .h-entry — skipping (error page?)\`); diff --git a/scripts/patch-webmention-sender-reset-stale.mjs b/scripts/patch-webmention-sender-reset-stale.mjs index b65596a1..8fa12a62 100644 --- a/scripts/patch-webmention-sender-reset-stale.mjs +++ b/scripts/patch-webmention-sender-reset-stale.mjs @@ -3,7 +3,7 @@ * with empty results because the live page was not yet deployed when the poller fired. * * Runs at startup but only executes once (guarded by a migrations collection entry). - * After running, the patch-webmention-sender-retry.mjs code fix prevents recurrence. + * After running, the patch-webmention-sender-livefetch.mjs v2 fix prevents recurrence. */ import { MongoClient } from "mongodb"; diff --git a/scripts/patch-webmention-sender-retry.mjs b/scripts/patch-webmention-sender-retry.mjs index a24991e6..075a8e23 100644 --- a/scripts/patch-webmention-sender-retry.mjs +++ b/scripts/patch-webmention-sender-retry.mjs @@ -91,6 +91,10 @@ for (const filePath of candidates) { } if (!source.includes(oldSnippet)) { + // livefetch v2 replaces the same block — this patch is intentionally superseded. + if (source.includes("[patched:livefetch:v2]")) { + continue; // silently skip; livefetch v2 is a superset of this patch + } console.log(`[patch] webmention-sender-retry: target snippet not found in ${filePath} (package updated?)`); continue; }