From d8c1bdba245f69edade45c8f0b65d1a4d3cd9aa3 Mon Sep 17 00:00:00 2001 From: gramps Date: Thu, 5 Nov 2026 14:53:06 -0800 Subject: [PATCH] =?UTF-8?q?feat(stream):=20RECONNECTING=20driven=20by=20th?= =?UTF-8?q?e=20status=20poll=20=E2=80=94=20no=20invented=20countdown=20(TA?= =?UTF-8?q?SK=2032=C2=B72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Controls/TopBar.xaml | 6 ++ HANDOFF.md | 7 ++- Services/YouTubeChatService.cs | 9 +++ TASKS.md | 2 +- TASKS/task-32-stream-resilience.md | 22 +++++-- ViewModels/MainViewModel.Recovery.cs | 87 ++++++++++++++++++++++++++- ViewModels/MainViewModel.Streaming.cs | 22 +++++-- ViewModels/MainViewModel.cs | 1 + ytLive.Tests/ChatEndedSignalTests.cs | 63 +++++++++++++++++++ 9 files changed, 201 insertions(+), 18 deletions(-) create mode 100644 ytLive.Tests/ChatEndedSignalTests.cs diff --git a/Controls/TopBar.xaml b/Controls/TopBar.xaml index c393a21..0f267a8 100644 --- a/Controls/TopBar.xaml +++ b/Controls/TopBar.xaml @@ -120,6 +120,12 @@ Foreground="White" Margin="8,0,0,0" VerticalAlignment="Center"/> + +