Repository navigation
fix(stream): keep the on-air panel live through auto-reconnects - #823
Draft
anneoneone wants to merge 2 commits into
Draft
anneoneone wants to merge 2 commits into
anneoneone wants to merge 2 commits into
Conversation
FlowOnAir ended the show on every socket close, including drops that useStreamSocket was already auto-reconnecting. After a successful reconnect audio kept flowing but the page stayed on "Stream Ended": the end-time auto-stop was skipped, and "Done" unmounted the page without stopStream()/stopCapture() (both guarded by !streamEnded), so the stream could stay on air after the host left. onDisconnected now gets `willReconnect`, true when an automatic reconnect is already scheduled. FlowOnAir ignores those closes and only ends the show on a final disconnect (gave up, error frame, clean close). While the socket is reconnecting, the status bar shows "Reconnecting…" instead of LIVE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N2RWiX6eBm5kyYsSc8Vghq
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A final disconnect set streamEnded but left audio capture running. The capture is a singleton with no unmount hook, onUnmounted skips stopCapture() once streamEnded is set, and flow.reset() does not touch it, so the microphone stayed open even after "Done". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N2RWiX6eBm5kyYsSc8Vghq
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A connection drop that the stream socket is auto-reconnecting no longer ends the show in the live panel. Before, the panel switched to "Stream Ended" and could leave the stream on air after the host clicked "Done". When the show really ends, the microphone is now released.
Issue: none filed. This is the follow-up listed under "Not in this PR" in #819.
Validation (in
frontend/):npm run lint: clean.npm run typecheck: clean.npm test -- --run: 24 files, 183 tests passed (2 new).main'suseStreamSocket.ts.tscand ESLint here don't cover.vuefiles, so I also compiled the app withvite buildto checkFlowOnAir.vue. It builds cleanly.Implementation and review
This is an ordinary fix to
main, not architecture-epic work, so the epic fields do not apply.Epic: n/a
Executor: n/a
Lane: n/a
Reviewer: n/a
Leaf IDs: n/a
Bugs (
frontend/src/admin/pages/flow/FlowOnAir.vue).onDisconnectedsetstreamEndedon every socket close, including drops thatuseStreamSocketwas already auto-reconnecting. Since fix(stream): keep reconnect backoff going and reset it on success #819 those reconnects usually succeed. When one did:updateEndTimeCountdownonly stops when!streamEnded.stopStream()/stopCapture(), becauseonUnmountedguards both with!streamEnded. The stream could stay on air after the host had left.useAudioCaptureis a singleton with no unmount hook,onUnmountedskipsstopCapture()oncestreamEndedis set, andflow.reset()doesn't touch it. After the socket really closed, the microphone stayed captured, even after "Done".Fix.
useStreamSocket:onDisconnectednow receiveswillReconnect. It istruewhen an automatic reconnect is already scheduled, andfalsefor a final close: retries used up, anerror:frame, a clean close, orstopStream()/cleanup(). The argument is optional to read, so the other consumers (StreamPage.vue,RecordingPage.vue,LiveSetupTest.vue) behave exactly as before.FlowOnAir.vue: closes withwillReconnectare ignored. The streaming view, elapsed timer, metrics and end-time stop keep running.onLivefires again when the stream is back. If the retries run out, the final close ends the show as before, and now also callsaudioCapture.stopCapture().FlowOnAir.vuestatus bar: while the socket isconnectingorconnected(not yet live) during a live show, it shows a yellow "Reconnecting…" instead of "LIVE". The producer is off air at that point. The same label also appears during a manual reconnect.Tests (
frontend/tests/useStreamSocket.test.ts).tells onDisconnected whether an auto-reconnect is scheduled:truefor the drop and for each failed attempt that still has one queued,falseonce the last attempt fails.reports error-frame closes and stopStream() as final disconnectsThere is no test that mounts
FlowOnAir.vue. The repo has no component-test setup (@vue/test-utilsisn't installed), and mounting the page would mean mocking the router, the host flow, audio capture, the APIs and four child components. The page changes are a guard on the new argument plus onestopCapture()call in the existing final-disconnect branch.GitNexus impact. Not run: the GitNexus MCP server failed to connect in this session and there is no local index. By text search,
onDisconnectedis passed touseStreamSocketbyFlowOnAir.vue,StreamPage.vue,RecordingPage.vue,LiveSetupTest.vueandFlowStreaming.vue. No route usesFlowStreaming.vue. OnlyFlowOnAir.vuereads the new argument.Not in this PR.
FlowStreaming.vuehas the sameonDisconnectedpattern but is not routed, so I left it alone.🤖 Generated with Claude Code
https://claude.ai/code/session_01N2RWiX6eBm5kyYsSc8Vghq