Skip to content

Preserve AuthService in the authentication sheet environment - #1398

Open
MatthewCallery wants to merge 2 commits into
firebase:mainfrom
MatthewCallery:codex/preserve-auth-service-in-sheet
Open

MatthewCallery wants to merge 2 commits into
firebase:mainfrom
MatthewCallery:codex/preserve-auth-service-in-sheet

Conversation

@MatthewCallery

Copy link
Copy Markdown

Fixes #1397.

Presenting AuthPickerView from a UIKit-hosted SwiftUI view on Mac Catalyst can crash because the sheet's descendants cannot find AuthService, even when the picker has .environment(authService). Explicitly pass the existing service into the primary sheet after its account-conflict and MFA modifiers, matching the explicit injection already used for the nested legacy recovery sheet.

Validation in a consuming UIKit/SwiftUI app, using the patched package based on FirebaseUI 16.1.0:

  • Six focused hosted tests passed on iPhone 17 Pro Simulator (iOS 26.5).
  • The same six tests passed on Mac Catalyst (macOS 26.6.2).
  • The presentation regression checks Apple/Google provider labels, dismissal without account preparation, and simulated successful authentication reaching account preparation.
  • The unpatched picker reproduced the missing-AuthService crash on Catalyst and passed on iOS.

Built with Xcode 26.6 (17F113). Real provider OAuth and this repository's full test suites were not run. The diff is one line; no dependency versions are changed.

@google-cla

google-cla Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request injects the authService into the environment of the AuthPickerView's navigation stack. I have no feedback to provide.

@demolaf demolaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

There's a flaky CI run that's meant to be fixed in this PR #1394, I'll try to get that merged and then this PR can be rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AuthPickerView sheet loses AuthService environment on Mac Catalyst

2 participants