inspector/clients/web/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall f5a3ccedbb fix: type-discriminate progress toast ids, CSPRNG attempt-id fallback
Both findings from the v2.5.0 milestone-merge review (#2215).

1. `progressToastId` collided across distinct progress streams.
   `ProgressToken` is `string | number`, so `String(token)` mapped the
   numeric token 7 and the string token "7" onto one id — and because
   notifications keyed by the same id are *replaced* rather than
   stacked, two concurrent streams overwrote each other's toast. The
   absent case was worse: it hardcoded the sentinel "default", which a
   server is free to send as a genuine string token. The id now carries
   the token's type (`progress-n:7` / `progress-s:7`) and gives the
   no-token case a prefix of its own (`progress-none`) that no token
   value can produce.

2. `newAttemptId`'s fallback now prefers `crypto.getRandomValues`.
   `randomUUID` needs a secure context; `getRandomValues` does not and
   exists in every browser that has `crypto` at all — so the exact
   situation the fallback exists for (a `file://` page, a plain-HTTP
   non-loopback host) still has a CSPRNG on hand. `Math.random` stays
   as the last resort for a `crypto`-less global, and the "never a
   security token" comment stays too. Retires CodeQL alert 72
   (`js/insecure-randomness`) honestly rather than by dismissing it.

Tests: collision cases for 7 vs "7" and the absent token vs "default" /
"none", a distinctness sweep over the whole id space; and the attempt-id
fallback test split into a getRandomValues arm (asserting the CSPRNG is
used and `Math.random` is not) and a no-crypto-at-all arm.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uw1s4LRBUzrFwLzPT4mAJn
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-09-05 13:36:30 -04:00
..
components Merge branch 'v2/main' into v2/feat/2234-skills-extension 2026-09-05 12:50:10 -04:00
hooks fix: address Copilot review round 13 on #2251 2026-09-05 01:40:28 -04:00
lib fix: type-discriminate progress toast ids, CSPRNG attempt-id fallback 2026-09-05 13:36:30 -04:00
test Merge branch 'v2/main' into v2/feat/2234-skills-extension 2026-09-05 12:50:10 -04:00
theme fix(a11y): make the form error color meet WCAG AA in both schemes 2026-08-23 12:56:13 -04:00
types chore: close a batch of quality-gate & tidy gaps (#1785 #1787 #1789 #1790 #1767) (#1792) 2026-07-26 10:43:11 -04:00
utils fix: type-discriminate progress toast ids, CSPRNG attempt-id fallback 2026-09-05 13:36:30 -04:00
App.css feat(web): use the Ace JSON editor everywhere, and restore the raw-JSON toggle 2026-08-27 02:24:22 -04:00
App.test.tsx fix: resolve the clear's identity from the live client, in one place (#2217) 2026-09-04 00:02:45 -04:00
App.tsx fix: address Copilot review round 13 on #2251 2026-09-05 01:40:28 -04:00
index.ts feat: port CLI, TUI, and launcher from v1.5 into v2 (#1452) 2026-06-14 20:27:49 -04:00
main.tsx fix(a11y): make the form error color meet WCAG AA in both schemes 2026-08-23 12:56:13 -04:00