Finish session architecture with heartbeat, routing, and tap-to-resend - #9
Merged
Merged
Conversation
Extract heartbeat, payload routing, and status derivation from ChatSession so it only orchestrates. Outbound keeps payloads for late acks and resend, presence prunes silent peers, and the room cache drops in-flight pending markers. RoomManager no longer leaks the session. Failed self messages show as 发送中/未送达 and can be tapped to retry over the same v1 wire. Co-authored-by: Andy <mail@andychen.net>
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.
Completes the architecture split started in #6 and #8.
ChatSessionis now an orchestrator: heartbeat, payload routing, and status copy live in their own modules,RoomManagerno longer leaks the session, and failed self messages can be tapped to resend on the existing v1 wire.What changed
deriveStatus+sameStatus).lastSeenAt).pendingmarkers but keepsfailedso reload can retry.isJoined()/resend()instead ofgetSession().Still static GitHub Pages, public WebTorrent/Nostr signalling, no TURN, no libp2p, no PWA, no protocol v2, no restyle.
Test plan
npm test(53 tests)npm run build:pagesCI on this branch is green. Local two-window check on the Vite app confirmed P2P join, bidirectional chat, and the 送达 mark on self bubbles.