chore: align package README names, harden headers getter, simplify forEach loops#1464
Merged
Merged
Conversation
…rEach loops - Fix package README headings that still used the old `*-dart` repo slugs (gotrue, realtime_client, storage_client, supabase) to match the actual pub package name. - Return an unmodifiable copy from SupabaseClient.headers and use arrow syntax, mirroring functions_client so external mutation cannot silently desync from the internal map. - Replace forEach-with-closure loops with plain loops in postgrest_filter_builder.match (drops a closure reassignment) and realtime_client transformers (drops an unused value parameter).
grdsdev
approved these changes
Jun 25, 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
A small batch of cleanups in the same spirit as #1458 / the recent
functions_clientsimplifications.gotrue,realtime_client,storage_client, andsupabasestill used the old*-dartrepo slugs in their first heading. Aligned them to the actual pub package name (matching the earlierfunctions-dart→functions_clientfix).SupabaseClient.headers: wasget headers { return _headers; }, returning the internal map directly. Now returnsMap.unmodifiable(_headers)with arrow syntax, mirroringfunctions_client. This prevents callers from mutating the returned map and silently desyncing from the internal state (header changes must go through theheaders=setter, which propagates to all sub-clients).forEachclosures → plain loops:postgrest_filter_builder.match(): dropped the reassign-inside-closurequery.forEach((k, v) => url = ...)for aforloop.realtime_clienttransformers.convertChangeData:record.forEach((key, value) {...})had an unusedvalueparameter →for (final key in record.keys).Why
Consistency across package READMEs, and closing a small footgun on the public
headersgetter so external mutation can't quietly diverge from what the sub-clients actually send.Verification
dart format --set-exit-if-changed: cleandart analyze libon postgrest, realtime_client, supabase: no issuesclient_test(incl. Headers Management),utilities_test,mock_test, and realtimetransformers_testpass. Pre-existing integration tests that require a local server are unaffected.Note on the
headerschangeThis is technically a behavior change on a public getter: external
client.headers['x'] = ypreviously no-op'd (the mutation was lost) and now throws. The supported path to change headers remains theheaders=setter.