From c4364b7cec773e4a3f06fd724cecae505a92737a Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Tue, 17 Nov 2026 16:03:36 -0600 Subject: [PATCH] fix(aggregator): build fragment watchdog recovery notice with DOM APIs --- pm-stack/aggregator/src/render.ts | 6 +- .../test/frag-watchdog-1503.test.ts | 72 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/pm-stack/aggregator/src/render.ts b/pm-stack/aggregator/src/render.ts index cb4a2a5926..2dfcf861e1 100644 --- a/pm-stack/aggregator/src/render.ts +++ b/pm-stack/aggregator/src/render.ts @@ -403,7 +403,11 @@ setTimeout(function () { if (!skel) return; var p = document.createElement("p"); p.className = "frag-failed"; - p.innerHTML = "the live view did not arrive — load the full page"; + p.textContent = "the live view did not arrive — "; + var a = document.createElement("a"); + a.setAttribute("href", "?full=1"); + a.textContent = "load the full page"; + p.appendChild(a); skel.replaceWith(p); }); }, ${FRAG_WATCHDOG_MS}); diff --git a/pm-stack/aggregator/test/frag-watchdog-1503.test.ts b/pm-stack/aggregator/test/frag-watchdog-1503.test.ts index 007dde2347..4d752c4399 100644 --- a/pm-stack/aggregator/test/frag-watchdog-1503.test.ts +++ b/pm-stack/aggregator/test/frag-watchdog-1503.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; +import { Script } from "node:vm"; import { fixtureSource } from "../src/sources/fixtures.ts"; import { FRAG_WATCHDOG_MS, @@ -28,6 +29,14 @@ describe("shell fragment watchdog (#1503)", () => { ]; expect(shells).toHaveLength(5); for (const html of shells) { + // Oracle: the JavaScript parser must accept the actual rendered script, + // not merely find recognizable strings inside invalid JavaScript (#11410). + const watchdog = [...html.matchAll(/