feat(supabase_flutter): default debug logging off under flutter test#1530
Merged
Conversation
Vinzent03
reviewed
Jul 3, 2026
Vinzent03
reviewed
Jul 3, 2026
72413d8 to
0f59ac1
Compare
Tr00d
approved these changes
Jul 6, 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.
What
Makes
Supabase.initialize'sdebugoption default tofalsewhen running underflutter test, so tests no longer emitINFO/CONFIGlog noise unless they explicitly opt in withdebug: true.Why
debugdefaults todebug ?? kDebugMode. Underflutter test,kDebugModeistrue, so every test that doesn't passdebug: falseattaches the log subscription and spams the console (***** Supabase init completed *****, etc.). Rather than sprinklingdebug: falseacross every test, this fixes the default at the source.This is the more general fix behind #1529 (which added
debug: falseper call). With this change those manual additions are no longer needed, so #1529 can be closed in favor of this.How
Reuses the existing web-safe
isRunningInFlutterTestgetter (already used insupabase_auth.dart, defined via theplatform_stub.dart/platform_io.dartconditional import, which reads theFLUTTER_TESTenv var):Production behavior is unchanged:
isRunningInFlutterTestisfalseoutside tests (and the web stub returnsfalse), so the expression reduces to the previousdebug ?? kDebugMode.Verification
test/debug_default_test.dartasserts the default is off underflutter testand that explicitdebug: truestill logs.packages/supabase_fluttersuite: all 59 tests pass with no stray supabase log output;flutter analyze --no-fatal-infosis clean.