docs(dart): require onError handler in onAuthStateChange examples#44946
docs(dart): require onError handler in onAuthStateChange examples#44946
Conversation
…ples Network errors (e.g. offline token refresh) are emitted as stream errors on onAuthStateChange. Without an onError handler, Dart rethrows them as unhandled zone exceptions, crashing the app. Add a warning note and update all three code examples to include onError. Fixes: supabase/supabase-flutter#1281 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated the Supabase Dart v2 documentation to require providing an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Remove redundant inline comments from switch cases — event names are self-explanatory. Reformat event-type note as a clean list and move onError warning first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Braintrust eval report
|
Summary
onAuthStateChange()that anonErrorhandler is requiredonErrorBackground
Network errors (e.g. a token refresh attempted while the device is offline) are emitted as stream errors on
onAuthStateChange. If noonErrorhandler is provided, Dart rethrows them as unhandled zone exceptions, crashing the app.This is tracked in supabase/supabase-flutter#1281. The SDK itself already handles this internally (
supabase_auth.darthas its ownonError), but user-facing code that calls.listen()withoutonErroris still vulnerable.The companion SDK fix (example app + doc comment in
gotrue_client.dart) is in a separate PR insupabase/supabase-flutter.Test plan
/docs/reference/dart/auth-onauthstatechange)onError🤖 Generated with Claude Code
Summary by CodeRabbit