AuthPickerView sheet loses AuthService environment on Mac Catalyst
@demolaf ya está trabajando en esto.
Desde el 18/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment
- Swift, using
FirebaseAuthSwiftUI,FirebaseAppleSwiftUI, andFirebaseGoogleSwiftUIthrough Swift Package Manager - FirebaseUI 16.1.0
- Firebase 11.12.0; GoogleSignIn 7.1.0
- Mac Catalyst on macOS 26.6.2, Xcode 26.6 (17F113), SDK 26.5, Swift 6.3.3
- Comparison run: iPhone 17 Pro Simulator, iOS 26.5
Reproduction
In a UIKit-hosted SwiftUI view, use the documented stock picker pattern:
AuthPickerView {
Text("Minimal FirebaseUI host")
}
.environment(authService)
Configure authService with Apple and Google providers, attach the hosting controller to a window, then set authService.isPresented = true.
Our hosted XCTest reproduces a fatal error on Catalyst while presenting the sheet:
No Observable object of type AuthService found.
A View.environmentObject(_:) for AuthService may be missing as an ancestor of this view.
The same stock-picker presentation test passes on iOS Simulator. The Catalyst failure also reproduces with a plain SwiftUI sheet containing an @Environment(AuthService.self) reader, suggesting a sheet environment propagation problem rather than provider configuration. Waiting until the presenting content is rendered did not avoid the crash.
Proposed fix
Explicitly inject .environment(authService) into AuthPickerView's primary sheet content, after .mfaHandler(). The nested legacy recovery sheet already injects it explicitly.
Both a temporary prototype and the actual patched package passed presentation, dismissal, and simulated successful-authentication handling on iOS Simulator and Catalyst. The consuming app ran six focused hosted tests per platform with zero failures. Real Apple/Google OAuth and the FirebaseUI repository's full test suites were not exercised. I am submitting the corresponding patch.
- Lenguaje dominante
- Swift
- Estrellas
- 1.6k
- Forks
- 495
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 5
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
type: docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
googleapis/google-cloud-swift#971 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Move wallpaper setting Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
manaflow-ai/cmux#13417 ·