You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: CAPSceneDelegateProxy mutates token after capture by a sendable closure #8662
Building an iOS app with Xcode 27 (27A266a) reports:
Capacitor/CAPSceneDelegateProxy.swift:24: warning: 'token' mutated after capture by sendable closure
scene(_:willConnectTo:options:) declares var token, captures it in the addObserver(forName:object:queue:using:) block (which is @Sendable), then assigns to it after the capture. It works at runtime because the block runs on the main queue after the assignment, but the compiler can't see that, and under Swift 6 language mode this is an error.
Expected Behavior
No warning. Holding the token in a small reference box captured by the closure, or using a one-shot Task over NotificationCenter.default.notifications(named: .capacitorViewDidAppear), avoids mutating a captured variable.
Project Reproduction
Any Capacitor 8.5.x iOS app built with Xcode 27 shows it. The warning comes from the shipped CAPSceneDelegateProxy.swift, so no app code is involved.
Activity