Harden session lifecycle, timers, and canonical room routing - #10
Merged
Merged
Conversation
Failed joins now tear down the transport instead of leaking a zombie connection. Outbound ack timers pause while the tab is hidden, presence prune skips peers still in the ICE set, and inbound payloads dispatch through the router. Room names are canonical at the navigation boundary, empty rooms are rejected, the hash router is a single pipeline, and the log cache snapshots on a debounce. Still v1 wire, static Pages, no TURN. Co-authored-by: Andy <mail@andychen.net>
Andyccr
marked this pull request as ready for review
September 17, 2026 21:07
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.
Full architecture audit after #9. This PR hardens the remaining lifecycle, timer, and navigation gaps without changing the v1 wire or leaving the static Pages constraint.
What was wrong
go()racedhashchangeand could double-open; empty room names were joinable; App catch clobbered relay diagnostics.What changed
transport.peerIds().applyIncomingdispatches hello/typing/ack/chat.RoomSpec— one name at lobby, jump, hash, recent, and RoomManager. Empty names rejected.go()only writes the hash;hashchangeroutes.canJoin(), nick commits before send.Still static GitHub Pages, public WebTorrent/Nostr, no TURN, no libp2p, no PWA, no protocol v2.
Test plan
npm test(62 tests)npm run build:pages茶 室from lobby → URL and tab use茶-室