Repository navigation
chore: spell out abbreviations in internal code, tests, and examples - #1709
Conversation
|
Warning Review limit reached
Next review available in: 3 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (38)
📝 WalkthroughWalkthroughThis pull request replaces abbreviated identifiers with descriptive names across the launcher and Supabase Dart packages. It updates request variables, exception bindings, helper names, JWT claim locals, retry callbacks, test fixtures, and documentation examples without changing runtime behavior. ChangesDescriptive naming cleanup
Estimated code review effort: 2 (Simple) | ~15 minutes Mergeability Score: ⚪ Minimal · up to This change only expands internal names and test/example identifiers without altering public APIs or wire formats; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Non-breaking counterpart to SDK-1479: renames abbreviations in private members, @internal declarations, tests, and example apps. No public API changes. Package internals: - StackTrace stack -> stackTrace (postgrest, storage, gotrue, yaji) - catch (e) -> catch (error), or catch (_) where the value was unused - res -> response, bodyStr -> bodyString, qs -> queryParameters - opts -> options on the @internal RealtimeChannel.send - val -> value on the @internal fromString methods - fn -> action in supabase_common retry - _receivedResp / _recHooks -> _receivedResponse / _receiveHooks - timerCalc -> timerCalculation, bindingsLen -> bindingsLength - lastIdx / valTrim -> lastIndex / trimmedValue - obj1 / obj2 -> first / second, obj -> presencesByKey - curPresences / curPresenceRefs -> current… - _handleRes -> _handleResponse, pChar / char -> previousCharacter / character - …Params locals and private members -> …Parameters - exp / iat locals -> expiresAt / issuedAt - re -> whitespaceRegularExpression Tests: - sut and sut* helpers -> client, createOAuthClient, authorizeClient, logIn - exp / iat -> expiresAt / issuedAt - capturedOpts / opts -> capturedOptions / options - tParams -> channelConfig, sub -> subscription, objectInfo -> objectMetadata Examples: - args / flutterArgs -> arguments / flutterArguments - _parseEnv -> _parseEnvironment, msg -> message, str -> jsonString
02170e9 to
2a2deb9
Compare
## What kind of change does this PR introduce?
Breaking change, refactor. Closes SDK-1479.
## What is the current behavior?
A repository-wide sweep found public identifiers that still use
abbreviations: `setAuth`, `queryParams`, `opts`, `vsn`,
`heartbeatIntervalMs`, the Iceberg `spec` cluster, and more.
## What is the new behavior?
They are spelled out, continuing the precedent set by `conn` to
`connection`.
**The wire format is untouched.** Wherever a JSON key, query parameter
or URL path matched the abbreviation, only the Dart identifier is
renamed and the literal key stays: `vsn`, `presence_ref`,
`iss`/`sub`/`aud`/`exp`/`nbf`/`iat`/`jti`, `kty`/`key_ops`/`alg`/`kid`,
`authorization_params`, `token_endpoint_auth_method`, `sseType`,
`spec-id`, `spec-ids`, `default-spec-id`, `partition-specs`, `refs`,
`doc`, `timestamp-ms`, `max-ref-age-ms`, `max-snapshot-age-ms`,
`last-updated-ms`, and the `/object/info/` path.
### Highlights
Across every package: `setAuth()` → `setAccessToken()`, `queryParams:` →
`queryParameters:`, `opts:` → `options:`, `PresenceOpts` →
`PresenceOptions`, and
`appendSearchParams`/`overrideSearchParams`/`toQueryParams` →
`…Parameters`.
`realtime_client`: `params` → `parameters`, `endPoint`/`endPointURL` →
`endpoint`/`endpointUrl`, `wsCloseNormal` → `webSocketCloseNormal`,
`RealtimeProtocolVersion.vsn` → `wireVersion`, `Presence.presenceRef` →
`presenceReference`, and the `RealtimeChannel` constructor takes
`config:` instead of `params:` (it always took a
`RealtimeChannelConfig`).
`supabase_auth`: the JWT claim and header fields spell out their names,
`User.aud` → `audience`, the four `…Params` option classes become
`…Options`, `validateExp` → `validateExpiration`, `AMRMethod`/`AMREntry`
→ `AuthenticationMethodReference`/`AuthenticationMethodReferenceEntry`.
`storage_client`: `StorageFileApi.info()` → `getMetadata()`, `sseType` →
`serverSideEncryptionType`, the Iceberg `spec` cluster becomes
`…Specification…`, `TableField.doc` → `documentation`,
`TableMetadata.refs` → `references`.
### Enums use the built-in `name`
`AuthChangeEvent.jsName` is gone rather than renamed: the enum declares
`name` itself, so `AuthChangeEvent.signedIn.name` is `'SIGNED_IN'`, the
value it always sent. The internal `fromString` therefore matches on the
wire value; writer and reader both use `.name`, so nothing round-trips
differently.
`TableSnapshotScope` drops its redundant `value` field, since `all` and
`refs` already match what the catalog expects, and `.name` returns the
same string.
### Type changes
`RealtimeClient.heartbeatInterval` and the function returned by
`reconnectAfter` use `Duration` instead of millisecond counts, and the
Iceberg fields that carried an `Ms` suffix drop it for `Duration`
(`maxReferenceAge`, `maxSnapshotAge`) or `DateTime`
(`Snapshot.timestamp`, `TableMetadata.lastUpdated`).
### Deliberately not renamed
`JWK`/`JWKSet` (more common than spelling them out), `PlatformInfo`,
`uuidRegex`, `YAJsonIsolate` (matches its package),
`RealtimeLogLevel.warn` (the wire value), and the `signup`/`magiclink`
enum values on `GenerateLinkType`/`OtpType` (their `snakeCase` already
produces the wire value). Also `rpc(String fn, {params})`, the PostgREST
operator family and `PostgresChangeFilterType`, for cross-SDK parity.
## Additional context
`MIGRATION.md` gains a section listing every rename, and
`sdk-compliance.yaml` is reconciled. The three supabase/sdk checks
(`check-api-symbols`, `check-drift`, `validate-compliance`) pass
locally, as do `dart analyze`, `dart format`, `dcm analyze` and every
package's test suite against a local Supabase stack.
Internal identifiers, tests and examples landed separately in #1709
(SDK-1480), which this branch is rebased on top of.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added utilities for converting millisecond values into UTC timestamps
and `Duration` values.
- Added migration guidance for updated public API names and types.
- **Breaking Changes**
- Replaced abbreviated public identifiers with descriptive names across
authentication, realtime, storage, PostgREST, functions, and shared
models.
- Authentication token setters now use `setAccessToken`.
- Realtime timing options use `Duration`, and timestamp fields use
`DateTime`.
- JSON, URL, query, and wire-format names remain unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
What
Non-breaking counterpart to SDK-1479: spells out abbreviations in private members,
@internaldeclarations, tests, and example apps.No public API changes, so no
MIGRATION.mdentry and nosdk-compliance.yamlreconciliation. The threefromStringmethods,RealtimeChannel.sendandGotrueFetchtouched here are all@internal; everything else is a local, a private member, a positional parameter, a test, or an example.Wire format is untouched throughout: JSON claim keys (
exp,iat,sub), error keys (msg), Phoenixref, and query keys all keep their literal spelling. Only the Dart identifiers around them changed.Package internals
StackTrace stackstackTracecatch (e)catch (error)helper.dart,fetch.dart,gotrue_client.dart, supabase, storage, realtime, plus doc-comment examplesresresponsegotrue_client.dart,supabase_auth.dartbodyStrbodyStringoptsoptions@internalRealtimeChannel.sendvalvalue@internalfromStringmethods in gotrue and realtimefnactionretry.dart_receivedResp,_recHooks_receivedResponse,_receiveHookspush.darttimerCalctimerCalculationretry_timer.dartbindingsLenbindingsLengthrealtime_channel.dartlastIdx,valTrimlastIndex,trimmedValuetransformers.dartobj1,obj2first,secondRealtimeChannel._isEqualobjpresencesByKeyRealtimePresence._mapand_cloneDeepcurPresenceRefscurrentPresenceRefsrealtime_presence.dart_handleRes_handleResponse_isolates_io.dartpChar,charpreviousCharacter,charactersnake_case.dart_appendParams,urlParams,searchParams,effectiveQueryParams…Parametersexp,iatlocalsexpiresAt,issuedAtgotrue_client.dartrewhitespaceRegularExpressionTests
sut,sut*helpersclient,createOAuthClient,authorizeClient,logIngotrue/test/src/gotrue_oauth_api_test.dartexp,iatexpiresAt,issuedAtcapturedOpts,optscapturedOptions,optionsrealtime_client/test/channel_test.darttParamschannelConfigrealtime_client/test/socket_test.dartsubsubscriptionsupabase_common/test/supabase_common_test.dartobjectInfoobjectMetadatastorage_client/test/client_test.dartExamples
args,flutterArgsarguments,flutterArgumentsexamples/launcher_parseEnv_parseEnvironmentexamples/launcher/lib/launcher.dartmsgmessagepackages/realtime_client/example/main.dartstrjsonStringDeviations from the ticket
curPresencesisremainingPresences, notcurrentPresences. InsyncDiffthe enclosing scope already declarescurrentPresences, andcurPresencesis the filtered subset of it that has to be re-inserted, so the ticket's name would have been a self-referencing redeclaration.remainingPresencessays what it holds.catch (e)clauses in the supabase_flutter example never read the caught value, so they becamecatch (_)rather than declaring an unusederror.qstoqueryParametersin gotruefetch.dart, and the(val)closure parameters in realtimetransformers.dartand a functions_client doc comment.Left alone as out of scope: the public
optsonSupabaseClient.channel/RealtimeChannel.track/untrack,rpc(String fn),JwtPayload.exp/iat,validateExp, testenvlocals, single-letter closure parameters, and wire or third-party names.Testing
dart analyzeis clean acrosspackagesandexamples, and all nine test suites pass against a local Supabase stack: gotrue (458), storage_client (220), realtime_client (211), postgrest (196), supabase (134), supabase_common (79), supabase_flutter (76), functions_client (48), yet_another_json_isolate (27).Resolves SDK-1480.
Summary by CodeRabbit
Refactor
Tests
Documentation