Skip to content

fix(auth): build auth exceptions with the configured string provider - #2508

Open
demolaf wants to merge 2 commits into
version-10.0.0-beta05from
auth/error-string-provider
Open

fix(auth): build auth exceptions with the configured string provider#2508
demolaf wants to merge 2 commits into
version-10.0.0-beta05from
auth/error-string-provider

Conversation

@demolaf

@demolaf demolaf commented Sep 11, 2026

Copy link
Copy Markdown
Member

Auth error messages were built at throw time from a string provider that was never the one the host configured. Every call site in the provider extensions either passed a bare Context, which resolves against the device locale, or passed nothing and fell through to the raw Firebase SDK string, which is what #2506 hit on the phone path. The correct provider was already in scope at all 21 sites as config.stringProvider.

Routing it through made the top-level dialog controller churn on every recomposition for hosts that build their configuration inline, losing dialogs that had just been shown, so TopLevelDialogController no longer holds a provider and reads LocalAuthUIStringProvider at render time. Its previous constructor and factory are kept as deprecated overloads.

Added routing tests for the converted sites and a dialog-lifetime regression test, each verified to fail on the old code.

@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 refactors error message resolution to consistently honor the host's configured AuthUIStringProvider and locale. It updates TopLevelDialogController to resolve strings from LocalAuthUIStringProvider at render time, deprecates explicit provider arguments, and adds comprehensive unit tests for localized error routing across all auth providers. A critical stale lambda capture bug was identified in rememberTopLevelDialogController where the unkeyed remember block caches the initial authState lambda, preventing the controller from receiving updated state in production. It is recommended to use rememberUpdatedState to resolve this issue.

@demolaf
demolaf marked this pull request as ready for review September 11, 2026 15:26
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.

1 participant