Skip to content

docs(auth): correct the auth README against the GA API surface, and fix two broken exception messages - #2530

Open
demolaf wants to merge 2 commits into
pre-GAfrom
docs/auth-readme-ga-api
Open

demolaf wants to merge 2 commits into
pre-GAfrom
docs/auth-readme-ga-api

Conversation

@demolaf

@demolaf demolaf commented Sep 22, 2026

Copy link
Copy Markdown
Member

auth/README.md documented an API that does not exist: AuthState as a sealed hierarchy of data classes, an MFA section that builds a config object and never passes it anywhere, and an error when covering half the exception types with no else. Corrected against the source on pre-GA, with the hand-maintained test-tag table replaced by the naming rule the test suite already enforces.

Changes

  • AuthState block: abstract not sealed, nothing is a data class, Error.exception is typed Exception, plus Success.reauthenticatedUid, isNotification and the AuthState.Reauthentication hierarchy, with a note on what each means for caller code.

  • MFA Configuration now passes mfaConfiguration to FirebaseAuthScreen, which is where it goes. It is a screen parameter, not a property of authUIConfiguration, and the old example dropped the object it built.

  • Error Handling covers all 21 AuthException subclasses and ends with an else, since AuthException is not sealed and the missing branches previously failed silently.

  • Test tags: the 32-row table becomes the fui_<object_snake_case>_<CONSTANT_lowercase> rule, the 13 grouping objects, and a pointer to FirebaseAuthTestTags, citing the reflective assertions in FirebaseAuthTestTagsTest.

  • The stability promise is rescoped from "a value documented here" to every constant on FirebaseAuthTestTags, bringing the 27 constants the table omitted inside it.

  • Sign Out documents that signOut clears Google Credential Manager state and the Facebook LoginManager session for linked providers, with the Facebook step guarded by a classpath probe.

  • The FirebaseAuthScreen parameter table is marked partial and points at Custom UI with Slots for the seven slot parameters; the drifting "~170 abstract vals" count is dropped rather than re-pinned.

  • Fixes the localization example, which defined SpanishStringProvider with no constructor parameters and then called SpanishStringProvider(context), so the snippet did not compile.

  • Repairs two AuthException messages that read "You are are attempting...", the second also missing a word. Own commit, since it is source rather than docs.

Validation

Five sweeps re-run on the finished README: symbol resolution, named arguments against each callee, required arguments against each signature, Compose calling context, and anchor/TOC resolution (56 anchors, all resolve, modelling GitHub's duplicate-heading suffixing).

The string change carries ./gradlew :auth:testDebugUnitTest --rerun-tasks: BUILD SUCCESSFUL, 49 tasks executed, 1101 tests, 0 failures or errors. Verified as a real run rather than cached results by diffing the 82 test classes under auth/src/test against the 82 in auth/build/test-results, none missing, all XMLs written during this run.


Maintainer note: Refs internal CPRN-490

@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 updates the auth/README.md documentation to reflect API changes in AuthState (transitioning from a sealed class to an abstract class), and adds detailed guidance on MFA configuration, test tags, sign-out behavior, and error handling. The feedback points out that the companion object properties in the documented AuthState class must be initialized to be valid, compilable Kotlin, and provides a code suggestion to fix this.

Comment thread auth/README.md
Comment on lines +462 to +464
@JvmStatic val Idle: Idle
@JvmStatic val Cancelled: Cancelled
@JvmStatic val Aborted: Aborted

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.

medium

In Kotlin, properties declared inside a companion object must be initialized. To ensure the documented code block is valid and compilable Kotlin, please initialize these companion properties to match their actual implementation in AuthState.kt.

Suggested change
@JvmStatic val Idle: Idle
@JvmStatic val Cancelled: Cancelled
@JvmStatic val Aborted: Aborted
@JvmStatic val Idle: Idle = Idle()
@JvmStatic val Cancelled: Cancelled = Cancelled()
@JvmStatic val Aborted: Aborted = Aborted()

@demolaf
demolaf force-pushed the docs/auth-readme-ga-api branch 3 times, most recently from 0f52224 to 7de7f8d Compare September 22, 2026 10:22
@demolaf
demolaf force-pushed the docs/auth-readme-ga-api branch from 7de7f8d to 25d48b9 Compare September 22, 2026 10:26
@demolaf demolaf changed the title docs(auth): correct the auth README against the GA API surface docs(auth): correct the auth README against the GA API surface, and fix two broken exception messages Sep 22, 2026
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