STUDYU-57 fix(flutter_common): isolate debug storage by environment - #886
Draft
johannesvedder wants to merge 5 commits into
Draft
johannesvedder wants to merge 5 commits into
johannesvedder wants to merge 5 commits into
Conversation
|
Visit the preview URL for this PR (updated for commit fbdcaad):
(expires Tue, 21 Jul 2026 09:55:25 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b |
johannesvedder
force-pushed
the
fix/supabase-session-storage
branch
from
July 14, 2026 09:49
a7a25b3 to
fbdcaad
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.
Description
Switching
STUDYU_ENVwhile reusing fixed localhost ports caused Flutter web to restore Supabase sessions and participant-local data from the previous environment. The stale credentials produced invalid JWT and refresh-token failures until browser storage was cleared manually.This change namespaces all
SecureStoragekeys bySTUDYU_ENVin debug builds..env.devand.env.localtherefore keep separate sessions, participant credentials, selected subjects, caches, and onboarding state. Debug.envand all profile/release builds retain the existing unscoped keys, so deployed participants and Designer users keep their current storage behavior. Supabase fallback URLs within one environment continue sharing the same namespace.The storage namespace is selected before environment loading, and each operation resolves its key before waiting for the storage lock.
Testing Steps
--dart-define=STUDYU_ENV=.env.devand create or restore participant state..env.local; verify it does not restore the.env.devsession or participant data..env.dev; verify its previous debug state is restored.cd flutter_common && rtk fvm flutter test.scripts/pre-commit-checkfrom the repository root.PR Checklist
scripts/pre-commit-checkscripts/pre-commit-check