Commit 0787101
Auto-attach: restore manual-supersede under main's validation split; enable presence-online-preferred via live presence (#5792)
Two post-rebase changes:
1. Manual pairing must supersede an in-flight auto-attach at the TOP of
connectPairingURLResult, before validation, so even an invalid code
parks the background attempt (the documented invariant the
manualPairingSupersedes* / invalidManualHost* tests assert). Main's
#6028 refactor split the post-validation beginPairingAttempt(method:
"qr") out of the early path, so the supersede no longer rode on it.
Call supersedeInFlightAutoAttach() explicitly; it is guarded on
autoAttachInFlight, so it is a no-op when nothing is parked.
2. Presence #5792 has landed, so wire its live signal into auto-attach
target selection (deferred when the PR was opened). The shell already
owns a live PresenceMap from the device-tree subscription; derive
online device ids from it (new PresenceMap.onlineDeviceIDs, same
rollup rule as deviceSummary) when no explicit MobileAutoAttachPresence
provider is injected and presence data exists. The external provider
seam still wins if set, and an empty map (no presence yet) keeps the
recency-only path unchanged, so existing behavior and tests are
preserved. This stays behind the auto-attach flag.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent fb2b2b0 commit 0787101
3 files changed
Lines changed: 52 additions & 4 deletions
File tree
- Packages/CmuxMobileShell
- Sources/CmuxMobileShell
- Tests/CmuxMobileShellTests
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1669 | 1681 | | |
1670 | 1682 | | |
1671 | 1683 | | |
| |||
2530 | 2542 | | |
2531 | 2543 | | |
2532 | 2544 | | |
2533 | | - | |
2534 | | - | |
2535 | | - | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
2536 | 2552 | | |
2537 | 2553 | | |
2538 | 2554 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 | | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
119 | 136 | | |
0 commit comments