Fourth state machine. Orchestrates the per-leg FSMs: idle ──ENTER──▶ connecting ──WELCOME──▶ joined ──LEAVE──▶ leaving ──DONE──▶ idle ▲ │ FAILED │ ▲ │ ▼ │ WS_DROPPED │ │ idle ▼ │ │ reconnecting ──WELCOME──▶ joined │ │ │ LEAVE / FAILED │ │ ▼ │ │ leaving ────────────────────────────── ┘ │ ▲ │ │ ACK └─────────────────────────────────── booted ◀── BOOTED ── (any live state) Role lives in ctx (host / cohost / speaker / listener). ROLE_CHANGE re-enters joined so observers fire on every promotion / demotion — that's how the runtime decides whether to start mic+publish or stop them, without needing a state per role permutation. reconnecting handles signal-WS drops without tearing down the SubscribeFSM or PublishFSMs (WebRTC PCs are independent of the WS). booted is the explicit terminal for being kicked + ACK returns to idle so the entry screen comes back. + 19 unit tests. test-fsm now 72 passed. Next step: the integration layer — observers on each FSM that drive the actual side effects, plus integration tests that compose multiple FSMs (a CallFSM with SubscribeFSM + RemoteTileFSMs) to assert the multi-machine interactions match what the live code does. |
||
|---|---|---|
| .. | ||
| blog | ||
| fonts | ||
| chat.html | ||
| host-your-own.html | ||
| how-it-works.html | ||
| index.html | ||
| kernel.html | ||
| stamp.js | ||
| zebra-audio.html | ||
| zebra-spaces.html | ||