Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix Play services install and sign in flow #2924

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gino-m
Copy link
Collaborator

@gino-m gino-m commented Dec 13, 2024

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 (#2923).

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

@gino-m gino-m marked this pull request as ready for review December 13, 2024 22:06
@auto-assign auto-assign bot requested a review from sufyanAbbasi December 13, 2024 22:06
@gino-m gino-m removed the request for review from sufyanAbbasi December 13, 2024 22:07
} else {
Timber.d(error, "Unknown sign in error")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it Timber.e?

@@ -69,9 +71,11 @@ constructor(
override val signInState: Flow<SignInState> = _signInStateFlow.asStateFlow().filterNotNull()

override fun initInternal() {
Timber.d("Listening to Firebase auth state")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cleanup debug logs if they aren't needed anymore?

firebaseAuth.addAuthStateListener { auth ->
Timber.d("Firebase auth state changed")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@gino-m
Copy link
Collaborator Author

gino-m commented Dec 16, 2024

@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 #2934 to track, moving back to Draft :/

@gino-m gino-m marked this pull request as draft December 16, 2024 17:25
@gino-m gino-m changed the title [Startup] Fix Play services install and sign in flow [WIP] Fix Play services install and sign in flow Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants