fix(swift-ios): keep selected threads live across navigation - #11858
Open
mackinleysmith wants to merge 1 commit into
Open
mackinleysmith wants to merge 1 commit into
mackinleysmith wants to merge 1 commit into
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused Swift iOS bug fix that relocates selected-thread loading and subscription ownership to the workspace model, preventing navigation-driven cancellation and stale results. The runtime change is localized and supported by targeted concurrency tests, with no schema, product-default, infrastructure, or static-analysis configuration changes. You can add or adjust custom eligibility rules. Learn more. |
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 Changed
Switching between cached threads could leave old history on screen without a live subscription or a reconnect indicator. Split-view navigation could cancel the detail view's load and invoke its cleanup while the newly selected thread was still opening.
The workspace selection now owns a model-managed load and subscription. Switching or clearing selection cancels the previous load and releases its subscription; collapsing to the sidebar retains the selected thread. Retries use the same owner, cancelled results cannot replace newer history, and the view reads loading state from the model.
Why
This covers the cached-thread switching failure reproduced while reviewing #11491, including reopening during delayed credential renewal. It targets the current Swift app branch and does not depend on that PR. The existing cache/resume and foreground reconnect paths remain in use, with at most one selected thread subscription retained while the sidebar is visible.
The scope is the native Swift iOS client, across Back, swipe-back, thread selection, and retry. Provider adapters, wire contracts, and other clients do not change. This does not establish why an app might spontaneously return to the thread list after backgrounding.
Verification
FeatureRootModelTestsandNativeThreadCatchUpTestson iPhone 17e / iOS 26.5, with parallel simulator testing disabled.git diff --checkpassed.UI Changes
Before/after screenshots and a short simulator recording were captured. Upload is pending because no browser session was available for GitHub attachments.
Checklist
Model: GPT-6. Harness: Codex in T3 Code.