ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

[WIP] Fix Play services install and sign in flow

Open gino-m opened this issue 1 year ago • 3 comments

Replaces ephemeral navigation requests with a "main UI state" which gets applied at start up. This patch resolves existing issues, but there are likely several race conditions lurking due to complexity of the startup/install flow. We should revisit the design on this flow to make it easier to understand and to avoid cancellation exceptions or duplicate side effects (https://github.com/google/ground-android/issues/2923).

Fixes #2919 by restore UI state on on resume. Fixes #2783

gino-m avatar Dec 13 '24 22:12 gino-m

@shobhitagarwal1612 @anandwana001 This actually won't work - collecting the so-called "MainUiState" on resume will navigate the user away from their current screen in many cases (ToS, survey list, etc), since those screens are not represented in the UiState.

Filed https://github.com/google/ground-android/issues/2934 to track, moving back to Draft :/

gino-m avatar Dec 16 '24 17:12 gino-m

Main is currently navigating to the wrong target on config change. Instead, allow each Fragment to maintain its own state and navigation actions by moving sign-in flow logic out of Main and into StartUp, SignIn and TermsOfService as follows:

  • [ ] StartUp will direct to the Home if already signed in, SignIn if not.
  • [ ] SignIn will direct to TermsOfService if available, otherwise to SurveySelector.
  • [ ] TermsOfService will direct to Home.
  • [ ] Main will navigate to SignIn on sign-out.

gino-m avatar Dec 23 '24 20:12 gino-m

Main is currently navigating to the wrong target on config change. Instead, allow each Fragment to maintain its own state and navigation actions by moving sign-in flow logic out of Main and into StartUp, SignIn and TermsOfService as follows:

  • [ ] StartUp will direct to the Home if already signed in, SignIn if not.
  • [ ] SignIn will direct to TermsOfService if available, otherwise to SurveySelector.
  • [ ] TermsOfService will direct to Home.
  • [ ] Main will navigate to SignIn on sign-out.

@shobhitagarwal1612 @anandwana001 Do you want to want to pick these up?

gino-m avatar Jan 06 '25 15:01 gino-m