-
Notifications
You must be signed in to change notification settings - Fork 230
fix(auth): restore logged-in user on app resume #2856
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
base: dev
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
roll SDK for new auth state watcher method
Visit the preview URL for this PR (updated for commit e99014c): https://walletrc--pull-2856-merge-xbp8qpkn.web.app (expires Wed, 09 Jul 2025 15:01:22 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
…into codex/check-if-user-is-signed-in-on-app-resume
This pull request introduces enhancements to the app's lifecycle handling and authentication flow, ensuring that the user's authentication state is checked and restored during app lifecycle events. Key changes include adding a new
AuthLifecycleCheckRequested
event, implementing its handling inAuthBloc
, and integrating this check into the app lifecycle via_AnalyticsLifecycleHandlerState
.Enhancements to lifecycle handling:
lib/analytics/widgets/analytics_lifecycle_handler.dart
: Added_checkAuthStatus
method to check the user's authentication state during app lifecycle events (AppLifecycleState.resumed
and after the first frame). This method dispatches theAuthLifecycleCheckRequested
event to theAuthBloc
. [1] [2] [3]Updates to authentication flow:
lib/bloc/auth_bloc/auth_bloc.dart
: Added_onLifecycleCheckRequested
method to handle the newAuthLifecycleCheckRequested
event. This method checks the current user viaKomodoDefiSdk
and updates the authentication state if a user is logged in.lib/bloc/auth_bloc/auth_bloc_event.dart
: Introduced theAuthLifecycleCheckRequested
event to trigger authentication state checks during lifecycle changes.Integration with app initialization:
lib/main.dart
: Modified theAuthBloc
initialization to dispatch theAuthLifecycleCheckRequested
event immediately upon creation, ensuring the authentication state is checked at startup.Coins state update:
lib/bloc/coins_bloc/coins_bloc.dart
: Enhanced theCoinsBloc
to check for an existing user during initialization and emit aCoinsSessionStarted
event if the user is logged in.