Repository navigation
chore!: remove the v1 to v2 migration paths and expose defaultPersistSessionKey - #1681
Merged
spydon merged 3 commits intoAug 11, 2026
Merged
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Tr00d
approved these changes
Aug 10, 2026
spydon
force-pushed
the
chore/remove-v1-migration-paths
branch
from
August 10, 2026 13:35
da2bcd5 to
a3e85e0
Compare
spydon
force-pushed
the
chore/remove-v1-migration-paths
branch
2 times, most recently
from
August 10, 2026 14:37
3ff7ac0 to
60ae33c
Compare
supabasePersistSessionKey only existed for the migration from hive that supabase_flutter v1 needed, and the SDK never read it. It is gone, along with the MigrationLocalStorage and HiveLocalStorage snippets in the README, which migrated a v1 session out of hive. The custom LocalStorage example used the constant as its storage key, so it now takes the key as a parameter.
…ntations The key the session is persisted under was derived in two places and written out by hand in the docs on top of that, with nothing public to call. It now lives in supabase_common, which gotrue and supabase_flutter both already depend on, and supabase_flutter exports it the way postgrest and functions_client export HttpMethod.
spydon
force-pushed
the
chore/remove-v1-migration-paths
branch
from
August 10, 2026 14:47
60ae33c to
2b4d401
Compare
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.
Stacked on #1680, review that one first.
What kind of change does this PR introduce?
Cleanup and a small feature, breaking change.
What is the current behavior?
supabase_flutterstill carries the leftovers of the v1 to v2 migration:supabasePersistSessionKey, a public constant whose own dartdoc says "Only used for migration from Hive to SharedPreferences. Not actually in use." The SDK never reads it. It is only the key v1 stored the session under.MigrationLocalStorageandHiveLocalStoragesnippets to copy, which move a session out of hive on the first launch after upgrading from v1.The README's
MySecureStorageexample used the constant as its storage key, which was wrong for anything but a v1 leftover: the session lives under the key that is passed toLocalStorage,sb-<project-ref>-auth-tokenfor the default storage. That key was derived in two places (Supabase.initializeand, for the broadcast channel name,GoTrueClient) with nothing public to call, so a customLocalStoragehad no way to name the same key other than writing the format out by hand.What is the new behavior?
Both leftovers are gone. Anyone still on v1 can upgrade to v2, let it migrate the session, and then move to v3.
defaultPersistSessionKey(url)replaces the hand-written format. It lives insupabase_common, which gotrue and supabase_flutter both already depend on, andsupabase_flutterexports it the waypostgrestandfunctions_clientexportHttpMethod:The derivation now exists in exactly one place, and both call sites use it. Nothing changes for the default path:
Supabase.initializestill fills the key in, soSupabase.initialize(url:, publishableKey:)remains all a caller writes.The
Migrating Guidesection of the README pointed at the v1 to v2 upgrade guide on the docs site, and now points atMIGRATION.md, which is where the v2 to v3 changes are written down. Both docs also say explicitly that the key is derived for you and only needs naming when you supply your own storage, which was easy to misread before.Additional context
MIGRATION.mddocuments the removal, including the literal value of the constant for anyone who copied the old example and needs to keep reading the same key.sdk-compliance.yamldropssupabasePersistSessionKeyand registersdefaultPersistSessionKeyunderclient.session_management.persist_session. The capability itself staysimplemented. The symbol, drift and schema checks were run locally against the base and PR symbol dumps.