oficina / docs Public

Pin the raw=1 spelling with a testable URL builder (review fix)

Review found the raw=1 spelling had no coverage in the gate: it lived
only as inline string-building at both fetch call sites in
editor-entry.js, which has no test file (DOM-bound, by this repo's own
convention), so a typo like raw=true or a bare raw would pass all 15
existing tests while silently reintroducing the exact bug Task 7
exists to prevent — the browser refetching the same corrupt snapshot
forever.

Extracted updatesURL(base, { since, raw }) as a pure string builder in
live-updates.mjs, used by both call sites in editor-entry.js, and
pinned its exact output in live-updates.test.mjs for all four
combinations of since/raw. Confirmed a deliberate raw=true mutation
fails the new test (14 pass, 1 fail) before reverting it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 8f4ed427495295e3c0dab0eb66bd1d8b097ec4cc parent 850ffe2
4 files changed, +52 −17
  • fixtures/editor-entry.js +3 −3
  • fixtures/live-updates.mjs +17 −0
  • fixtures/live-updates.test.mjs +19 −1
  • internal/docs/static/{editor.9afcd625b7781c14.js => editor.6029d6f8d990c8a4.js} +13 −13
fixtures/editor-entry.js

Loading diff…

fixtures/live-updates.mjs

Loading diff…

fixtures/live-updates.test.mjs

Loading diff…

internal/docs/static/{editor.9afcd625b7781c14.js => editor.6029d6f8d990c8a4.js}

Loading diff…