Skip to content

refactor!: remove all deprecated APIs and dead public surface for v3 - #1661

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-1428-v3-remove-deprecated-apis
Aug 6, 2026
Merged

refactor!: remove all deprecated APIs and dead public surface for v3#1661
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-1428-v3-remove-deprecated-apis

Conversation

@spydon

@spydon spydon commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes SDK-1428. Part of #1278.

Removes every @Deprecated declaration across the packages, plus two pieces of dead public surface that were never marked but have no reason to survive a major version.

Deprecated APIs removed

Removed Replacement Package
AuthChangeEvent.userDeleted none, it was never emitted gotrue
OAuthProvider.snakeCase OAuthProvider.name gotrue
User.confirmedAt User.emailConfirmedAt gotrue
ReturningOption none, it was unused postgrest
PostgrestClient.auth() PostgrestClient.setAuth() postgrest
RealtimeClient.longpollerTimeout none, there is no longpoll transport realtime_client
ChannelResponse.rateLimited none, it was never returned realtime_client
FileObject.lastAccessedAt, FileObjectV2.lastAccessedAt none, the server does not populate it storage_client
createSignedUrls returning List<SignedUrl> createSignedUrls returning List<SignedUrlResult> storage_client
AuthUser User supabase
RealtimeClientOptions.eventsPerSecond none, it was already ignored supabase
RemoveSubscriptionResult none supabase
SupabaseRealtimeError none supabase
SupabaseEventTypes and SupabaseEventTypesName none, it was unused supabase
SupabaseStreamBuilder.execute() listen to the builder directly supabase
Supabase.initialize(anonKey:) Supabase.initialize(publishableKey:), now required supabase_flutter

Three of these are more than a field going away.

createSignedUrlsResult takes over the createSignedUrls name (SDK-1002). Dart has no overloading, so the version that reports per-path failures had to ship under a temporary name while the old one that silently dropped unsignable paths was still around. With the old one gone the temporary name can go too.

publishableKey becomes a required named parameter on Supabase.initialize, which also removes the runtime assertion that one of the two keys was passed. A legacy anon key is still a valid value, it just goes under the new name.

Both lastAccessedAt fields were required constructor parameters, so code that builds a FileObject or FileObjectV2 by hand drops that argument. User.confirmedAt is likewise no longer parsed from or written to JSON, so toJson() output no longer carries a confirmed_at key.

Not deprecated, but removed too

A pass over the public surface turned up two things worth taking with them:

  • Transports held a single websocket string constant used at exactly one call site, a leftover of the phoenix/realtime-js port. Inlined at the call site.
  • The dart.library.js conditional export fallback in yet_another_json_isolate existed for Dart below 3.3, while every package in the repo already requires >=3.9.0.

I also considered renaming Constants to RealtimeConstants in realtime_client and dropping the typedef RealtimeConstants = Constants that fronts it. I left it alone: RealtimeConstants is already the only name exported, so the rename buys consumers nothing, while the symbol extractor treats all five of its static members as new public API and would force registering constants like wsCloseNormal and defaultHeaders in sdk-compliance.yaml as if they were capabilities. Not worth the matrix churn for an invisible rename, and it deserves its own decision if anyone wants it.

Larger reshapes that have their own tickets are deliberately left alone: SDK-818 (private RealtimeClient fields, which is also where the stringly-keyed stateChangeCallbacks map belongs), SDK-817 (DateTime instead of String timestamps), SDK-1287 and SDK-1313 (retry config), SDK-820 and SDK-1289 (typed rows).

Notes

MIGRATION.md gets a section per removal under v2 to v3, with before/after snippets for the ones that need more than a rename.

sdk-compliance.yaml needs no change. Its only affected entry is StorageFileApi.createSignedUrls, which keeps its name, and every other removed symbol was unregistered.

Testing

dart analyze --fatal-infos is clean across the workspace, as is flutter analyze on the examples. Both capability-matrix checks pass locally against origin/main as the base (check-api-symbols and check-drift). Every package's tests pass against a local Supabase stack: gotrue (460), postgrest (196), storage_client (210), realtime_client (203), supabase (134), supabase_flutter (63), functions_client (48), yet_another_json_isolate (22).

Summary by CodeRabbit

  • Documentation
    • Added v3 migration guidance for removed APIs, initialization updates, and signed URL handling.
  • Breaking Changes
    • Supabase.initialize now requires a publishableKey.
    • Removed deprecated authentication, realtime, storage, and database APIs and fields.
    • Signed URL creation now returns per-path success or failure results through createSignedUrls.
  • Updates
    • Passing null to setAuth clears the authorization header.
    • Simplified realtime configuration and stream access APIs.

@spydon
spydon requested a review from a team as a code owner August 6, 2026 11:20
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 536e2eea-73d5-410e-8d33-47215cf8003b

📥 Commits

Reviewing files that changed from the base of the PR and between bea73e3 and b751829.

📒 Files selected for processing (2)
  • MIGRATION.md
  • packages/gotrue/test/src/constants_test.dart
🚧 Files skipped from review as they are similar to previous changes (2)
  • MIGRATION.md
  • packages/gotrue/test/src/constants_test.dart

📝 Walkthrough

Walkthrough

This PR removes deprecated v3 APIs across GoTrue, PostgREST, Realtime, Storage, and Supabase. It requires publishableKey during initialization, renames signed-URL handling, updates migration guidance and tests, and changes the web conditional export.

Changes

v3 API cleanup

Layer / File(s) Summary
Auth and PostgREST API removal
MIGRATION.md, packages/gotrue/..., packages/postgrest/...
Deprecated authentication events, OAuth accessors, user fields, and the PostgREST auth method were removed. Related tests and migration guidance were updated.
Realtime constants and timeout updates
packages/realtime_client/...
Legacy transport, timeout, and rateLimited response members were removed. WebSocket endpoint construction now uses /websocket.
Signed URL result API
MIGRATION.md, packages/storage_client/...
The bulk signed-URL API uses createSignedUrls with per-path success or failure results. Documentation and tests were updated.
Supabase initialization and exports
MIGRATION.md, packages/supabase/..., packages/supabase_flutter/...
Supabase.initialize requires publishableKey. Deprecated realtime options, classes, enums, exports, and related tests were removed.
Web conditional export
packages/yet_another_json_isolate/...
The web export now relies only on dart.library.js_interop.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: v3

Suggested reviewers: tr00d

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the removal of deprecated APIs and unused public surface for v3.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lukasklingsbo/sdk-1428-v3-remove-deprecated-apis

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/gotrue/lib/src/types/user.dart (1)

72-72: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve legacy confirmation data during session restore.

User.fromJson now ignores confirmed_at, and User.toJson no longer writes it. A v2-persisted user payload can contain confirmed_at without email_confirmed_at. Restoring that payload then sets User.emailConfirmedAt to null.

If v2 session payloads remain restorable, read email_confirmed_at first and fall back to confirmed_at. Continue writing only email_confirmed_at. Add a regression test.

As per coding guidelines, add or maintain tests for modified package behavior.

Proposed compatibility fix
-      emailConfirmedAt: json['email_confirmed_at'],
+      emailConfirmedAt:
+          json['email_confirmed_at'] ?? json['confirmed_at'],
#!/bin/bash
set -euo pipefail

rg -n -C 5 --glob '*.dart' \
  "confirmed_at|email_confirmed_at|User\.fromJson|User\.toJson|Session" \
  packages/gotrue packages/supabase packages/supabase_flutter

Also applies to: 104-104

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/gotrue/lib/src/types/user.dart` at line 72, Update User.fromJson to
populate emailConfirmedAt from email_confirmed_at first, falling back to
confirmed_at when the new field is absent, while leaving User.toJson writing
only email_confirmed_at. Add a regression test covering restoration of a legacy
payload containing confirmed_at without email_confirmed_at.
🧹 Nitpick comments (1)
packages/gotrue/test/src/constants_test.dart (1)

87-92: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression test for the removed event name.

The change removes the positive userDeleted assertions, but it does not verify that the old serialized name is rejected. Add expect(AuthChangeEvent.fromString('userDeleted'), isNull) to the invalid-name test.

As per coding guidelines, maintain tests for modified package behavior and run backend-dependent GoTrue tests with dart test -j 1.

Proposed test addition
       test('fromString returns null for invalid names', () {
         expect(AuthChangeEvent.fromString('invalid'), isNull);
+        expect(AuthChangeEvent.fromString('userDeleted'), isNull);
         expect(AuthChangeEvent.fromString('SIGNED_IN'), isNull);

Also applies to: 119-123

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/gotrue/test/src/constants_test.dart` around lines 87 - 92, Update
the invalid-name test for AuthChangeEvent to assert that
AuthChangeEvent.fromString('userDeleted') returns null, covering rejection of
the removed serialized event name. Keep the existing invalid-name assertions
intact and run the backend-dependent GoTrue tests with dart test -j 1.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@MIGRATION.md`:
- Around line 118-119: Update the migration introduction around the v3
deprecated-surface statement to limit the claim to removed APIs that have
documented replacements, removing the assertion that every entry has one. Keep
the surrounding deprecation and version context unchanged.

In `@packages/postgrest/lib/src/postgrest.dart`:
- Around line 87-88: Update setAuth to remove every authorization header key
case-insensitively before applying or clearing the token, including clients
initialized with differently cased keys; preserve the documented null-clears
behavior and add a regression test covering this case. Run the PostgREST package
tests sequentially with dart test -j 1.

---

Outside diff comments:
In `@packages/gotrue/lib/src/types/user.dart`:
- Line 72: Update User.fromJson to populate emailConfirmedAt from
email_confirmed_at first, falling back to confirmed_at when the new field is
absent, while leaving User.toJson writing only email_confirmed_at. Add a
regression test covering restoration of a legacy payload containing confirmed_at
without email_confirmed_at.

---

Nitpick comments:
In `@packages/gotrue/test/src/constants_test.dart`:
- Around line 87-92: Update the invalid-name test for AuthChangeEvent to assert
that AuthChangeEvent.fromString('userDeleted') returns null, covering rejection
of the removed serialized event name. Keep the existing invalid-name assertions
intact and run the backend-dependent GoTrue tests with dart test -j 1.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dc24978b-bc51-42da-95b4-bf10016df85e

📥 Commits

Reviewing files that changed from the base of the PR and between e06f230 and b0f853e.

📒 Files selected for processing (30)
  • MIGRATION.md
  • packages/gotrue/lib/src/constants.dart
  • packages/gotrue/lib/src/types/types.dart
  • packages/gotrue/lib/src/types/user.dart
  • packages/gotrue/test/custom_oauth_provider_test.dart
  • packages/gotrue/test/src/constants_test.dart
  • packages/gotrue/test/src/types/user_test.dart
  • packages/postgrest/lib/src/postgrest.dart
  • packages/postgrest/lib/src/types.dart
  • packages/realtime_client/lib/src/constants.dart
  • packages/realtime_client/lib/src/push.dart
  • packages/realtime_client/lib/src/realtime_client.dart
  • packages/realtime_client/lib/src/types.dart
  • packages/realtime_client/test/channel_test.dart
  • packages/realtime_client/test/mock_test.dart
  • packages/realtime_client/test/socket_test.dart
  • packages/storage_client/lib/src/storage_file_api.dart
  • packages/storage_client/lib/src/types.dart
  • packages/storage_client/test/basic_test.dart
  • packages/supabase/lib/src/auth_user.dart
  • packages/supabase/lib/src/realtime_client_options.dart
  • packages/supabase/lib/src/remove_subscription_result.dart
  • packages/supabase/lib/src/supabase_event_types.dart
  • packages/supabase/lib/src/supabase_realtime_error.dart
  • packages/supabase/lib/src/supabase_stream_builder.dart
  • packages/supabase/lib/supabase.dart
  • packages/supabase/test/mock_test.dart
  • packages/supabase/test/utilities_test.dart
  • packages/supabase_flutter/lib/src/supabase.dart
  • packages/yet_another_json_isolate/lib/yet_another_json_isolate.dart
💤 Files with no reviewable changes (14)
  • packages/supabase/lib/src/auth_user.dart
  • packages/supabase/lib/src/supabase_stream_builder.dart
  • packages/supabase/lib/src/supabase_event_types.dart
  • packages/supabase/lib/src/supabase_realtime_error.dart
  • packages/gotrue/lib/src/constants.dart
  • packages/supabase/test/mock_test.dart
  • packages/gotrue/lib/src/types/types.dart
  • packages/gotrue/test/src/types/user_test.dart
  • packages/postgrest/lib/src/types.dart
  • packages/supabase/lib/src/remove_subscription_result.dart
  • packages/gotrue/test/custom_oauth_provider_test.dart
  • packages/supabase/lib/supabase.dart
  • packages/supabase/lib/src/realtime_client_options.dart
  • packages/supabase/test/utilities_test.dart

Comment thread MIGRATION.md Outdated
Comment thread packages/postgrest/lib/src/postgrest.dart
Drops every `@Deprecated` declaration across the packages, plus two
pieces of dead surface that were never marked but have no reason to
survive a major version:

- `Transports` held a single `websocket` string used at one call site,
  now inlined.
- The `dart.library.js` export fallback in `yet_another_json_isolate`
  targeted Dart below 3.3, while every package requires `>=3.9.0`.

`createSignedUrlsResult` takes over the `createSignedUrls` name now that
the overload that silently dropped unsignable paths is gone, and
`publishableKey` becomes required on `Supabase.initialize`.
@spydon
spydon force-pushed the lukasklingsbo/sdk-1428-v3-remove-deprecated-apis branch from b0f853e to bea73e3 Compare August 6, 2026 11:39
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Also narrows the MIGRATION.md claim that every removed API has a
replacement, which is not true of the entries that were already inert.
@spydon
spydon merged commit 1ffa0de into main Aug 6, 2026
43 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-1428-v3-remove-deprecated-apis branch August 6, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants