google / google/ground-android

[Startup] "Initializing" spinner gets stuck on startup

Open
#2,919 3 comments 0 reactions 1 assignee Claimed by @shobhitagarwal1612 View on GitHub
type: bug
Dominant language
Kotlin
Stars
293
Forks
149
Avg merge
1d 16h
Merged PRs (30d)
42

Description

This occurs when the app is opened in the background (e.g., via Android Studio) while the phone is locked, or after completing the Google Play Services install flow and returning to the app.

The root cause is that the sign in event occurs while the `MainActivity` isn't running. `MainViewModel` emits the `navigationRequests`, but `MainActivity` is not there to receive it. To resolve this:

* The `signInState` in `AuthenticationManager` should be a `StateFlow`. We have one now, but we convert to a `Flow` because we call `filterNotNull()`.
* Either Navigation events should only be triggered from within the Fragment lifecycle.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.