Repository navigation
fix(desktop): capture self weakly in the outer closure so main compiles under Xcode 27 - #14322
Merged
Merged
Conversation
…es under Xcode 27 Three sites wrote [weak self] only on an inner closure while the enclosing escaping closure captured self strongly. Swift 6.3 rejects the mismatch; the CI-pinned Xcode 26.6 accepts it, so CI stayed green while local builds on the newer toolchain failed. Move the capture list to the outer closure. Failure-Class: new Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ture fix Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
Summary
maindoes not compile under Xcode 27 (Swift 6.3). Three call sites put[weak self]on an inner closure while the enclosing escaping closure capturedselfstrongly, which the newer compiler rejects:AppState+Transcription.swift— the microphone and system-audioonAudioChunkhandlers.FloatingControlBar/NetworkReachability.swift—NWPathMonitor.pathUpdateHandler.The fix moves
[weak self]to the outer closure at each site. That is also what the code already meant: with a strong capture in the outer closure the innerweakprotected nothing. Both objects live for the app's lifetime, so runtime behaviour does not change.The CI-pinned Xcode 26.6 accepts the old form, so every lane was green while local builds on the newer toolchain failed. The new form is valid on both.
Failure-Class: new
Product invariants affected
Cited only because
NetworkReachability.swiftlives underdesktop/macos/Desktop/Sources/FloatingControlBar/**, which that invariant locks. The change is a capture list on a reachability callback; it does not touch transcript ownership, the chat shell, or any rendered surface.Evidence
xcrun swift build -c debug --build-tests --package-path Desktop→Build complete! (318.84 sec). Onorigin/main@ 492c62f the same command fails at the sites above (first inAppState+Transcription.swift:546and:601, thenNetworkReachability.swift:42once those compile).Layer measured: compilation of app and test targets only. No tests were run locally and no app was launched.
🤖 Generated with Claude Code