Repository navigation
fix(mobile): drop a desktop's conversations while it is not connected - #1343
Merged
Merged
Conversation
The merged list drew every paired desktop's catalogue, and a catalogue outlives the connection that delivered it: a desktop that was connecting, was warming its agent up, or was gone still put its last rows in the list — under a header that already described that machine as unreachable, with rows this phone could not open until it answered again. `CatalogEntry` now carries the machine's `MachineStatus`, the same judgement the picker's row and the badge make, and `mergeSessions` draws rows only from a `connected` machine. The other three states keep their catalogue (so the rows come back with the connection) and contribute nothing, including when the picker names that machine: the screen's own "unreachable" state is the answer there, as it already was for a machine with no cached rows. `machines` still lists every paired desktop, so the picker and the badge keep reporting a machine that is down. Evidence: `mergeSessions` case spanning all four statuses in one list; provider case asserting both catalogues' statuses and the rows across a dropped handshake; screen case asserting a connecting peer draws no merged rows. All 149 mobile suites / 2861 tests green, `tsc --noEmit` and `eslint .` clean (Node 22, as CI uses Node 24).
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.
What and why
The sessions list on the phone kept showing a paired desktop's conversations after that desktop went offline, so tapping one opened a session that could no longer be reached. This PR drops a desktop's conversations from the merged list while that desktop is not connected, and restores them when it comes back.
Behaviour notes:
Commits
Verification
Run locally on the branch tip (
788d135eb), Node 22 (the CI line):npx tsc --noEmit(inmobile/) — cleannpx eslinton the 7 touched paths — cleannpx jest --runInBand src/remote/__tests__/RemoteContext.test.ts src/remote/__tests__/mergeSessions.test.ts src/remote/__tests__/useSessionCatalog.test.ts src/screens/__tests__/SessionsScreen.test.ts— 4 suites, 213 tests passed