Repository navigation
Ask for a reload when the live view drops, and only say shut down when it is - #488
Draft
tnsardesai wants to merge 1 commit into
Draft
tnsardesai wants to merge 1 commit into
tnsardesai wants to merge 1 commit into
Conversation
tnsardesai
force-pushed
the
hypeship/live-view-reconnect
branch
from
October 27, 2026 04:56
2b99563 to
0e05bf3
Compare
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.
Summary
The live view showed "Browser has been shut down and is no longer available" whenever its connection dropped after connecting, whether or not the browser was gone.
app.vuerenders that overlay for any!connected && wasConnected. So a network change, or a TURN relay that stops answering, told the viewer the browser had shut down while it was still running, and nothing on the page offered a way back. A viewer that believes the browser is gone doesn't reconnect, so the session stops counting as active and can idle out shortly after, which then makes the message true.This makes the overlay say which one happened, and offers a reload when the browser may still be running. It doesn't add automatic retry: #417's decision stands, and a connected viewer that drops still ends the connection and posts nothing new to the parent frame.
Changes
4410(session gone): "Browser has been shut down and is no longer available", as before.connection shutdownno longer pops a modal. neko sendssystem/disconnectwithconnection shutdownas it stops, on a restart and on browser teardown alike, and the client treated it as a server disconnect with a "Disconnected" modal over the overlay. That message is now left to the socket close that follows, which decides the state. Other server reasons (kicked,connection replaced, ...) are unchanged.The proxy sends
4410to a connected viewer once kernel/kernel#5023 ships; today it only sends it when a wake finds the instance gone. The two can ship in either order: until the proxy change is out, a torn-down browser shows "Lost connection" with Reload, and, from the proxy code, reloading a deleted session returns "Browser session no longer exists".Testing
bun test tests: 256 pass. New tests:4410close after connecting marks the session gone and opens no new socket;connection shutdownversus other server disconnect reasons.5 of them fail against
main.npm run buildpasses, with the same 17 lint warnings asmain. Prettier is clean. The production bundle still contains the websocket URL string the proxy rewrites to append the token, exactly once.End to end on a production headful image with this client swapped in, driven from headless Chromium 155:
supervisorctl restart nekoOn
main, the first two show "Browser has been shut down" with the browser still running. The4410→ "shut down" path is covered by unit tests here and by the proxy tests in the companion PR.Not covered: the image build and a fresh boot with this client, and Safari or Firefox.