Coalesce iOS presence recovery during startup reconnect - #10005
azooz2003-bit wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthrough
ChangesConnection recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant RecoveryTrigger
participant recoverMobileConnection
participant StartupIrohDial
participant ReplacementIrohDial
RecoveryTrigger->>recoverMobileConnection: Send recovery trigger
recoverMobileConnection->>StartupIrohDial: Preserve automatic recovery
RecoveryTrigger->>recoverMobileConnection: Request explicit recovery
recoverMobileConnection->>StartupIrohDial: Supersede active attempt
recoverMobileConnection->>ReplacementIrohDial: Start replacement attempt
ReplacementIrohDial-->>recoverMobileConnection: Connect successfully
Possibly related PRs
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite`+ConnectionRecovery.swift:
- Around line 92-103: Update the trigger switch in the isReconnectingStoredMac
and inactive connectionRecoveryOwner branch to list every current automatic
RecoveryTrigger case explicitly instead of using default; keep .manual and
.connectionMethodChanged as the non-coalesced cases, and preserve the existing
logging and return behavior for the enumerated automatic cases.
In
`@Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/IrohConnectionRecoveryOwnerTests.swift`:
- Around line 117-140: Add held-startup-dial recovery tests for both `.manual`
and `.connectionMethodChanged`, alongside
`presenceDuringStartupReconnectDoesNotSupersedeTheActiveDial`. For each trigger,
assert the recovery owner replaces the active startup dial, the stored reconnect
generation changes, and the original dial is superseded; release the held
attempts and verify exactly one replacement attempt reaches `.connected`.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 18b343fd-07ca-4c59-9e34-742528e0b2f3
📒 Files selected for processing (2)
Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+ConnectionRecovery.swiftPackages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/IrohConnectionRecoveryOwnerTests.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Verification on
The aggregate package command remains red from unrelated concurrent-suite failures in |
|
Hosted iPhone-simulator connection smoke also passes on the PR head: https://github.com/manaflow-ai/cmux/actions/runs/31527235580/job/93899147719 |
|
Superseded by #10090, which consolidates startup recovery, per-peer session ownership, diagnostics, stale discovery refresh, and the reliability workload. |
Mark’s beta logs showed an authenticated presence snapshot starting a second Iroh recovery while launch reconnect was already dialing. The nested reconnect advanced the stored-Mac generation, canceled launch, and retried the same route.
This coalesces automatic recovery triggers into the active startup restore while keeping manual retry and connection-method changes as explicit replacements. It also logs the coalesced trigger for future diagnostics.
Regression history:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Prevent nested reconnects during iOS startup by coalescing automatic recovery triggers into the active stored‑Mac restore. This avoids canceling the in‑flight dial, stops generation churn, and prevents duplicate Iroh dials.
isReconnectingStoredMac; keepmanualretry and connection‑method changes as explicit replacements.MobileDebugLog.anchormuxwith the current stored‑Mac generation.Written for commit 9c2d258. Summary will update on new commits.
Summary by CodeRabbit