Skip to content

fix(auth)!: resolve the 12 baselined Compose lint findings - #2504

Merged
russellwheatley merged 1 commit into
ci/run-android-lint-in-the-buildfrom
fix/baselined-compose-lint-findings
Sep 9, 2026
Merged

fix(auth)!: resolve the 12 baselined Compose lint findings#2504
russellwheatley merged 1 commit into
ci/run-android-lint-in-the-buildfrom
fix/baselined-compose-lint-findings

Conversation

@demolaf

@demolaf demolaf commented Sep 9, 2026

Copy link
Copy Markdown
Member

Android Lint's baseline shipped with 12 Compose findings suppressed so the new gate could go green. This fixes all 12 and drops those entries, leaving only CPRN-432's 168 localization ones.

MfaEnrollmentScreen.kt held the SDK's own MutableList in a MutableState, so a list mutated in place would have skipped recomposition; it now snapshots to an immutable List. Six of the seven LocalContextGetResourceValueCall sites sit in LaunchedEffect or semantics {} bodies where stringResource cannot be called at all, so they resolve in composition and close over the result. MfaEnrollmentDefaults.kt read the process-global locale, which disagrees with the Activity's configuration under a per-context locale override — it now reads LocalLocale.current.

ReauthScopeProbe.capture() is renamed Capture() (test-only, 27 call sites). No new tests: every finding is covered by the existing suite plus the lint gate itself, which now passes with zero Compose findings.

⚠️ Breaking Changes

AuthMethodPicker's customLayout moves to the last parameter so it can be passed as a trailing lambda. Positional callers break at compile time, and because the JVM descriptor changed, callers using named arguments need a recompile too. EmailAuthStep is internal, so the equivalent move there has no external effect.


Maintainer note: Fixes internal CPRN-436

@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 addresses several Compose correctness and localization warnings by resolving resource queries outside composable scopes, fixing non-observable locale usages, complying with Composable naming conventions, and snapshotting mutable collections to prevent state issues. The review feedback suggests optimizing resource lookups in AuthTextField by conditionally calling stringResource only when read-only, using a locale-aware DateFormat instead of a hardcoded pattern for internationalization, and refactoring asynchronous tasks in MfaEnrollmentScreen to use await() instead of addOnCompleteListener inside coroutines.

Comment thread auth/src/main/java/com/firebase/ui/auth/ui/components/AuthTextField.kt Outdated
@demolaf
demolaf force-pushed the fix/baselined-compose-lint-findings branch from 6b4bbe9 to b655249 Compare September 9, 2026 14:05
@demolaf
demolaf marked this pull request as draft September 9, 2026 14:31
@demolaf
demolaf marked this pull request as ready for review September 9, 2026 15:33
@russellwheatley
russellwheatley merged commit 8a6e3b8 into ci/run-android-lint-in-the-build Sep 9, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in studio-2394994192-60a69 Sep 9, 2026
@russellwheatley
russellwheatley deleted the fix/baselined-compose-lint-findings branch September 9, 2026 15:34
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.

2 participants