zebra-report/web
Russell Ballestrini aa36b84a47
zebra-spaces: stop subscribe→close→subscribe loop — listeners stay connected
Root cause of the 'late listener can't see screens' symptom: my recent
'rebuild sub PC on failure' commit (6a72e77) triggered on connection
state 'closed' as well as 'failed', AND the guard `if (sfuSubPC === pc)`
only worked because we ASSUMED Chrome would fire the state change
asynchronously. Chrome fires it SYNCHRONOUSLY during pc.close(), at
which point sfuSubPC still points at the closing pc — guard passes,
rebuild fires. Then sfuUnsubscribe closes the new PC, which triggers
another rebuild. SFU log showed listeners cycling
subscribe → 40s → close → subscribe forever.

Fix:
1. onconnectionstatechange now only rebuilds on 'failed' (the actually-
   terminal state). 'closed' = sfuUnsubscribe(), 'disconnected' =
   transient and WebRTC may recover on its own.
2. sfuUnsubscribe nulls sfuSubPC BEFORE pc.close(), so even if the
   handler fired synchronously the === guard would correctly fail.
3. visibilitychange handler also tightened to only fire on 'failed' —
   same reasoning.

The rebuild path for actual ICE failures still works (state goes
'connected' → 'disconnected' → 'failed' → rebuild).

83 FSM tests still green.
2026-06-02 11:36:05 -04:00
..
blog phase 1: unfirehose reconstruction from session JSONL ingest 2026-05-27 13:51:14 -04:00
fonts phase 2: gap analysis — cat>> append + binary asset recovery 2026-05-27 13:54:19 -04:00
chat.html css: .row uses minmax(0, max-content) so long labels shrink + wrap 2026-06-02 09:27:55 -04:00
host-your-own.html zebra: dark mode default on all pages + unified theme key 2026-06-01 22:18:02 -04:00
how-it-works.html zebra: dark mode default on all pages + unified theme key 2026-06-01 22:18:02 -04:00
index.html web: bump mobile body padding from 1rem to 1.25rem so the right edge has visible breathing room 2026-05-31 14:13:25 -04:00
kernel.html web: bump mobile body padding from 1rem to 1.25rem so the right edge has visible breathing room 2026-05-31 14:13:25 -04:00
stamp.js web: stamp each zebra-report page with build date + md5/sha256 2026-05-28 17:50:12 -04:00
zebra-audio.html css: .row uses minmax(0, max-content) so long labels shrink + wrap 2026-06-02 09:27:55 -04:00
zebra-spaces.html zebra-spaces: stop subscribe→close→subscribe loop — listeners stay connected 2026-06-02 11:36:05 -04:00