fix(supabase_flutter): log instead of swallow auth state stream errors#1346
Merged
fix(supabase_flutter): log instead of swallow auth state stream errors#1346
Conversation
Auth state stream errors (e.g. token refresh failures, network errors) were silently dropped in the onError handler. They are now logged at warning level with the full stack trace so developers can observe them. Also updated the initialize() dartdoc to document this behavior. Linear: SDK-811 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove unused gotrue import and put notifyException call on a single line so the ignore comment suppresses the internal_member lint correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ignore comment dart format splits long chains onto multiple lines, which moves the notifyException call off the line covered by the ignore comment. Extracting the auth client into a local variable keeps the ignore comment and the internal call on adjacent lines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mandarini
approved these changes
Apr 3, 2026
Vinzent03
requested changes
Apr 5, 2026
GoTrueClient.notifyException already logs errors before adding them to the stream. Remove the duplicate log and replace with a comment explaining why the handler exists (to prevent unhandled zone errors). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply dart format (tall style, Dart >=3.7) to auth_test.dart so the CI formatter check passes on Flutter stable (3.x). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Vinzent03
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onErrorhandler insideSupabaseAuth.initialize()warninglevel with full error and stack trace via the existing_loglogger (supabase.supabase_flutter)initialize()dartdoc to document this behaviorRoot Cause
packages/supabase_flutter/lib/src/supabase_auth.dart:51had an emptyonErrorcallback:Changes
supabase_auth.dart:onErrornow calls_log.warning(...)instead of ignoring the errorauth_test.dart: Added test that callsnotifyExceptionto emit an error on the stream and asserts it appears as aWARNINGlog recordTest Plan
Authentication > Auth state stream error handling > logs auth state stream errors at warning levelAcceptance Criteria
warninglevel with stack traceinitialize()dartdocCloses: SDK-811
🤖 Generated with Claude Code