fix(patches): silence retry noise, tighten h-entry check, fix stale comment
- retry: silently skip when livefetch:v2 marker is present instead of logging a misleading "target snippet not found (package updated?)" warning on every startup - livefetch: match `h-entry"` or `h-entry ` instead of bare `h-entry` to avoid false positives from body text containing the string - reset-stale: update comment to reference livefetch v2 (not retry) as the patch that prevents recurrence Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
// 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
|
// 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).
|
// 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;
|
contentToProcess = _html;
|
||||||
} else {
|
} else {
|
||||||
console.log(\`[webmention] Live page for \${postUrl} has no .h-entry — skipping (error page?)\`);
|
console.log(\`[webmention] Live page for \${postUrl} has no .h-entry — skipping (error page?)\`);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* with empty results because the live page was not yet deployed when the poller fired.
|
* 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).
|
* 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";
|
import { MongoClient } from "mongodb";
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ for (const filePath of candidates) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!source.includes(oldSnippet)) {
|
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?)`);
|
console.log(`[patch] webmention-sender-retry: target snippet not found in ${filePath} (package updated?)`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user