feat(stream): RECONNECTING driven by the status poll — no invented countdown (TASK 32·2)

Creator challenge (2026-11-05): "I really don't think that's going to be a constant — it's going to
depend on so many variables, some that are dark to us." Correct, so the measured-grace constant and
the countdown are dropped from the spec. YouTube's cutoff is server-side and depends on ingest health,
prior stream quality, region and load; a pinned number would be a guess wearing a timer, and it would
be wrong exactly when the creator is staring at it.

What ships instead:

- **Amber RECONNECTING** in the top bar with measured facts only: elapsed seconds and the attempt
  number ("0:12 · attempt 2 of 4"). The seconds come from a stopwatch started at the drop.
- **The status poll speeds up while recovering** (30 s → 4 s) and drives the sign; it restores 30 s
  when recovery ends.
- **`chatEndedEvent`** — already in the chat feed we poll and previously skipped — now raises a signal
  that prompts an immediate status check. It never decides anything: `liveBroadcasts.list`
  `lifeCycleStatus` stays authoritative, with `liveStreams.list` health as the push-received signal.
- At `complete`: red OFF AIR (the existing stop path) rather than a pretend-live sign.

Tests: `ChatEndedSignalTests` (the marker is not a chat row, the service raises the signal, and a
complete broadcast ends recovery with the honest message). FAST gate: 543 passed, 0 warnings.
This commit is contained in:
2026-11-05 14:53:06 -08:00
parent f2c43909c8
commit d8c1bdba24
9 changed files with 201 additions and 18 deletions
+16 -6
View File
@@ -23,12 +23,22 @@ the API — creator ruling 2026-09-01): no lying in the copy.
`FramePump.EncoderFailed` separating a dead push (recoverable) from a fatal pump fault. Each episode
reports into the left panel's alert stack; a reconnect that lands on a **complete** broadcast is
reported as such instead of showing a live sign over a dead stream. Tests: `StreamRecoveryTests`.
2. ☐ **Measured grace + the sign** — while the push is dead, escalate the existing health poll
(30s → ~5s). ON-AIR dot goes **amber "RECONNECTING"** with a mm:ss countdown to the observed
YouTube cutoff; the grace length is a **measured, pinned constant** — probe it on a real private
test stream, cite the observation (spin-guard rule; do NOT invent a number). Poll reports the
broadcast `complete` → dot **red "OFF AIR"**, primary button relabels **"● Back on air"** and
pulses. Test: fake status provider drives the dot through live → reconnecting → cut-off.
2. 🔶 **Poll-driven sign — NO invented countdown** (spec revised 2026-11-05, creator challenge:
*"I really don't think that's going to be a constant — it's going to depend on so many variables, some
that are dark to us"*). The original plan was a measured grace constant and a countdown to YouTube's
cutoff. **Dropped**: YouTube's cutoff is server-side and depends on things we cannot observe
(ingest node health, prior stream quality, region, load), so any pinned number is a guess wearing a
timer. What ships instead:
- **Amber RECONNECTING** in the top bar, with **measured** facts only: elapsed time and attempt
count ("RECONNECTING · 0:12 · attempt 2 of 4"). No countdown.
- **The status poll speeds up** while recovering (30 s → ~4 s) and drives the truth. Signals used,
cheapest first: `liveBroadcasts.list` `status.lifeCycleStatus` (authoritative `complete`),
`liveStreams.list` `status.streamStatus`/`healthStatus` (is the push being received), and the
**`chatEndedEvent`** YouTube already puts in the chat feed we poll — free, and previously skipped.
- At `complete`: **red OFF AIR**, stop retrying, and (slice 3) offer **Back on air**.
Test: a fake status provider drives the sign through live → reconnecting → off air; a `chatEndedEvent`
triggers an immediate status check rather than a decision of its own.
3. ☐ **One-click Back on air** — the relabeled button fires the existing go-live path with saved
`Broadcast.*` + cached stream, dialog skipped: new broadcast, new VOD (accepted cost, stated
in-product). Test: seeded saved form + fake stream service → click creates + pushes, no dialog.