A failure in the clock formatter runs before the rounds start and stops the page from probing #149

Closed
opened 2026-10-14 16:08:47 +02:00 by clawbot · 1 comment
Collaborator

web/src/main.js lines 1505 to 1521 and 1545, at v1.0.0-rc1: init() calls updateClocks() once, synchronously, before startRounds(). updateClocks builds new Intl.DateTimeFormat("en-US", { timeZoneName: "shortGeneric" }) and reads .formatToParts(now).find(...).value with no guard. A browser whose Intl does not accept shortGeneric (added in Chrome 95, Firefox 91 and Safari 15.4) throws a RangeError there; init then stops with the page drawn and every row at "waiting...", and no round ever starts, because the throw comes before startRounds(). The reporter a few lines up (lines 1468 to 1477) is wrapped so that its failure "must never stop the monitor from probing"; the clocks, which only decorate the header, are not.

How to see it: before the page loads, replace Intl.DateTimeFormat with one that throws when given timeZoneName: "shortGeneric" (DevTools override), or load the page in a browser older than those above: the rows never leave "waiting..." and the console shows the RangeError from init.

What is right: README.md Browser Compatibility says the page "Requires a modern browser with ES modules, Fetch API, Canvas API, and CSS custom properties"; a clock label format is not on that list, and the monitor should probe whether or not the clocks can be drawn.

Severity: low. Only browsers from before 2022 are affected, and the fix is to start the rounds before the clocks or to catch the clock formatter's error.

Definition of done

  • A failure in updateClocks (or anything else that only decorates the page) cannot stop startRounds(): the clocks are started after the rounds, or their formatter's error is caught and the clocks are left blank.
  • A unit test makes Intl.DateTimeFormat throw for shortGeneric and checks that a round still starts (or that updateClocks leaves the clocks blank and throws nothing).
  • TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.

Model: fable-5-1

`web/src/main.js` lines 1505 to 1521 and 1545, at `v1.0.0-rc1`: `init()` calls `updateClocks()` once, synchronously, before `startRounds()`. `updateClocks` builds `new Intl.DateTimeFormat("en-US", { timeZoneName: "shortGeneric" })` and reads `.formatToParts(now).find(...).value` with no guard. A browser whose `Intl` does not accept `shortGeneric` (added in Chrome 95, Firefox 91 and Safari 15.4) throws a `RangeError` there; `init` then stops with the page drawn and every row at "waiting...", and no round ever starts, because the throw comes before `startRounds()`. The reporter a few lines up (lines 1468 to 1477) is wrapped so that its failure "must never stop the monitor from probing"; the clocks, which only decorate the header, are not. **How to see it**: before the page loads, replace `Intl.DateTimeFormat` with one that throws when given `timeZoneName: "shortGeneric"` (DevTools override), or load the page in a browser older than those above: the rows never leave "waiting..." and the console shows the `RangeError` from `init`. **What is right**: `README.md` Browser Compatibility says the page "Requires a modern browser with ES modules, Fetch API, Canvas API, and CSS custom properties"; a clock label format is not on that list, and the monitor should probe whether or not the clocks can be drawn. **Severity**: low. Only browsers from before 2022 are affected, and the fix is to start the rounds before the clocks or to catch the clock formatter's error. ## Definition of done - [ ] A failure in `updateClocks` (or anything else that only decorates the page) cannot stop `startRounds()`: the clocks are started after the rounds, or their formatter's error is caught and the clocks are left blank. - [ ] A unit test makes `Intl.DateTimeFormat` throw for `shortGeneric` and checks that a round still starts (or that `updateClocks` leaves the clocks blank and throws nothing). - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number. Model: fable-5-1
clawbot self-assigned this 2026-10-14 16:08:47 +02:00
Author
Collaborator

Plan: one PR with #152, as both are small changes to web/src/main.js and test/unit/main.test.js. The rounds start before anything that only decorates the page, and a failure of the clock formatter is caught and leaves the clocks blank. Starts after #140, which changes the same files.

Model: opus-5-5

Plan: one PR with https://git.eeqj.de/sneak/netwatch/issues/152, as both are small changes to `web/src/main.js` and `test/unit/main.test.js`. The rounds start before anything that only decorates the page, and a failure of the clock formatter is caught and leaves the clocks blank. Starts after https://git.eeqj.de/sneak/netwatch/issues/140, which changes the same files. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#149