Repository navigation
Complete Iroh diagnostics and connection recovery - #10119
Conversation
…eliability # Conflicts: # Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/DiagnosticEventCode.swift # Packages/Shared/CMUXMobileCore/Tests/CMUXMobileCoreTests/DiagnosticEventPresentationTests.swift # Packages/Shared/CmuxIrohTransport/Sources/CmuxIrohTransport/CmxIrohClientSession.swift # Packages/Shared/CmuxIrohTransport/Sources/CmuxIrohTransport/CmxIrohRegistryContextProvider.swift
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (59)
📝 WalkthroughWalkthroughThe change adds transport diagnostic correlation, bounded dial timeouts, remote close classification, discovery-cache invalidation, mobile recovery diagnostics, sanitized build stamps, and an iOS network-log analyzer. ChangesDiagnostic contracts and presentation
Transport dialing and close attribution
Discovery freshness and invalidation
Mobile connection and recovery diagnostics
Build metadata and network-log analysis
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant MobileShellComposite
participant MobileCoreRPCSession
participant CmxIrohClientSession
participant CmxIrohRegistryContextProvider
participant NetworkLogAnalyzer
MobileShellComposite->>MobileCoreRPCSession: start connection attempt
MobileCoreRPCSession->>CmxIrohClientSession: connect using transport
CmxIrohClientSession->>CmxIrohRegistryContextProvider: resolve or refresh discovery
CmxIrohRegistryContextProvider-->>CmxIrohClientSession: return dial context
CmxIrohClientSession-->>MobileCoreRPCSession: return transport or classified failure
MobileCoreRPCSession-->>MobileShellComposite: record connected or cancelled event
MobileShellComposite->>NetworkLogAnalyzer: provide exported network log
NetworkLogAnalyzer-->>MobileShellComposite: return structured verdict
✨ 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 |
Summary
Verification
swift test --package-path Packages/Shared/CmuxIrohTransport --filter CmxIrohClientSessionTests --filter CmxIrohDiagnosticFailureTests --filter CmxIrohRegistryContextProviderStalenessTests --filter CmxIrohConnectionCloseAttributionTests --jobs 4swift test --package-path Packages/iOS/CmuxMobileShell --filter ReconnectRouteSelectionTests --filter IrohConnectionRecoveryOwnerTests --filter IrohZeroTouchDiscoveryTests --filter PresenceDiscoveryInvalidationTests --jobs 1python3 -m unittest scripts/tests/test_analyze_ios_network_log.pyNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Completes Iroh connection diagnostics and recovery: per-phase dial timeouts prevent hangs, stale discovery is invalidated on evidence, and reports now link dial attempts to admitted sessions with privacy-safe identifiers. Previously, dials could block until an outer deadline and discovery reuse could redial corpse routes; now, hung legs fail fast, fresh snapshots are fetched when needed, and cancellation ownership and remote close reasons are recorded.
.dialTimedOut; records leg success/failure inCmuxIrohClientSessionand classifies route errors.CmxByteTransportDiagnosticSessionIdentifying; emits.transportDialSessionLinked,.transportDialCancelled, and.transportCloseReason.DiagnosticRemoteCloseReason), records them from server close paths, and ignores free‑form lookalikes.DiagnosticBuildStampand adds peer-alias “surface” to network events inCMUXMobileCore.CmxIrohRegistryContextProvidertracks stale peers/device IDs and forces a single‑flight fresh broker snapshot after empty/unreachable plans or presence route pushes;CmxIrohClientRuntimeexposesinvalidateDiscoverySnapshot(forMacDeviceID:), whichCmuxMobileShellcalls on route updates.CmuxMobileRPCnow emits acancelledevent with aDiagnosticCancellationReasonand includessessionIDonconnected.scripts/analyze-ios-network-log.pywith tests to turn exported logs into actionable verdicts, anddocs/ios-network-reliability.mdfor the test workload.Migration
CmxIrohClientContextProviderimplementations can optionally implementnoteDialFailureto improve staleness invalidation;CmxByteTransportDiagnosticSessionIdentifyingis optional.Written for commit 99d1ea7. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes