Skip to content

Conversation

@hatamirais
Copy link
Collaborator

Summary

Fixes an exception that occurs during login when the widget unmounts before the async operation completes.

Problem

The login screen throws a StateError during debugging:

Bad state: Using "ref" when a widget is about to or has been unmounted is unsafe

This happens because ref.read(authProvider) was called after the async signInWithEmail but before the mounted check.

Solution

Moved the if (!mounted) return; check to occur before accessing ref.read() after the await, following Flutter/Riverpod best practices for async safety.

Impact

  • User impact: None (login already worked, just threw debug exceptions)
  • Risk: Low — simple reordering of existing code

@supabase
Copy link

supabase bot commented Feb 8, 2026

This pull request has been ignored for the connected project imveukxxtdwjgwsafwfl because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

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.

1 participant