Repository navigation
fix(ios): anchor Iroh connection diagnostics #8456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3a40c7e
test(iroh): pin foreground path diagnostics
e0333db
fix(iroh): anchor production connection diagnostics
b8f1b33
test(iroh): reject premature path publication
5316ef9
fix(iroh): publish only established selected paths
2be2f03
docs(ios): state production diagnostic ownership
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/CmxTransportSessionPurpose.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /// The local lifecycle role of a byte-transport request. | ||
| /// | ||
| /// This value never crosses the network. Transport pools use it to keep | ||
| /// foreground diagnostics anchored to the user-visible RPC connection when | ||
| /// background aggregation or feature lanes share the same endpoint. | ||
| public enum CmxTransportSessionPurpose: UInt8, Equatable, Sendable { | ||
| /// The control session powering the currently visible Mac workspace. | ||
| case foregroundControl = 1 | ||
| /// A control session keeping a non-selected Mac's workspace list current. | ||
| case backgroundControl = 2 | ||
| /// A short-lived request that discovers or validates a route. | ||
| case probe = 3 | ||
| /// An independent feature lane sharing an admitted Iroh session. | ||
| case featureLane = 4 | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publishSelectedPathChange()fires before the session is establishedpublishSelectedPathChange()is now called insidereserveControlOwnerat both the fast-path (controlOwners[key] = ...; publishSelectedPathChange(); return) and the slow-path continuation branch. At that pointsessions[key]is stillnil— the session hasn't been established yet.selectedObservedPath()guardsforegroundKeyandcontrolKeywithsessions[key] != nil, so the notification causes consumers to wake and read the old fallback path (or.unavailable) rather than the new foreground session's path. The session establishment fires a second notification that brings the correct value, so state is eventually consistent. The concern is that consumers will briefly observe either stale data from an older background session or.unavailablebetween control-owner registration and session connect, which could cause a visible flicker in connection-status UI. Consider deferring these twopublishSelectedPathChange()calls to the moment the session is added tosessions(which already fires its own notification via thesession(for:)path).