Skip to content

fix(pm-stack): fragment watchdog emits invalid JavaScript in recovery notice #11410

Closed

Description

@dezren39

Finding

pm-stack/aggregator/src/render.ts:399-409 embeds FRAG_WATCHDOG_SCRIPT in every fragment shell, but line 406 emits p.innerHTML = "the live view did not arrive &mdash; <a href="" + location.pathname + "?full=1">load the full page</a>";. The doubled quotes terminate the JS string; extracting the script body and running node --check reports SyntaxError: Unexpected string at that line. Consequently the browser cannot parse/execute the watchdog at all, so failed fragment loads remain stuck on their skeleton instead of showing recovery UI.

This code is included by renderBoardShell, renderAttentionShell, renderTodayShell, renderQueueShell, and renderOverviewShell (see render.ts:1743, 3646, 3884, 3961, 4161). Existing pm-stack/aggregator/test/frag-watchdog-1503.test.ts:20-39 only asserts rendered HTML contains the strings; it does not parse or execute the embedded JS.

Suggested fix

Use a valid JS string/template literal and construct/escape the link safely (e.g. DOM APIs or a correctly escaped constant). Add a regression test that extracts and syntax-checks the emitted watchdog script or executes it in a DOM test environment.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 17, 2026
  2. developing-today commented on Nov 17, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Queue disposition: deliberately not enqueued because this dispatched suggestions pass explicitly prohibits creating or dispatching further tasks. The finding and proposed direction are captured above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)status:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions