Repository navigation
fix(e2e): write the auth session under the key supabase-js actually reads - #578
Merged
Merged
Conversation
…eads auth.setup.ts derived the localStorage key by replacing every '.' and ':' in the full host, producing `sb-127-0-0-1-54321-auth-token`. supabase-js uses the first hostname label — `sb-127-auth-token` locally, and the project ref for a hosted URL (`abc123.supabase.co` -> `sb-abc123-...`). So every storage state this setup has written held a valid session under a key the client never reads. Specs authenticated successfully and then rendered the login screen, which is what #577 was filed against. Three derivations were wrong — one helper and two in-page copies. All now use the same rule. Verified: admin.json and user.json now contain `sb-127-auth-token` where they previously contained the long form. Not verified end to end, and it cannot be here. This machine's Supabase container clock is 26 hours behind the host, so every token it issues is already expired by browser time: token iat=1786405275 exp=1786408875 host now=1786498798 Any browser session built from those tokens is dead on arrival regardless of which key it is stored under. That is also what produced the earlier "JWT issued at future" rejections from PostgREST. The fix above is correct independently; proving it needs a machine whose container clock is sane.
Contributor
Author
|
Not merging this yet — CI cannot run. Every workflow across the repo has been failing since ~00:28 UTC, The failing jobs have zero steps and complete in 1 second with no logs and no annotations — the signature of Actions being unable to start jobs, not of a code failure. I am leaving this open rather than merging on an unverifiable green. Merging changes whose checks cannot execute is the exact failure mode this epic has been about. Verified locally in the meantime:
Ready to merge once Actions is working — or on your say-so if you would rather not wait. |
2 of 15 tasks
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.
Found while working #577. The premise of that issue was wrong, and this is the real blocker — see below.
The bug
auth.setup.tsderived the localStorage key by replacing every.and:in the full host:supabase-js uses the first hostname label —
sb-127-auth-tokenlocally, and the project ref for a hosted URL (abc123.supabase.co→sb-abc123-auth-token).So every storage state this setup has ever written held a perfectly valid session under a key the client never reads. Specs authenticated, saved state, loaded it, and rendered the login screen.
Three derivations were wrong — one helper and two in-page copies. All now use the same rule. Verified concretely:
admin.jsonanduser.jsonnow containsb-127-auth-tokenwhere they previously contained the long form.#577 was misdiagnosed — by me
I filed #577 saying
ApplicationsKanbanBoardrenders no test hooks and the helpers wait on selectors that match nothing. That is not true.@scaffald/ui'sKanbanColumnandKanbanCardalready settestID={kanban-column-${id}}andkanban-card-${id}, and those are present in the built output.What actually happened: the spec never reached the board, so I inferred a selector mismatch from an empty page snapshot instead of checking the component. Correcting it on the issue.
This is not verified end to end, and it cannot be on this machine
The local Supabase container's clock is 26 hours behind the host, so every token it issues is already expired by browser time:
Any browser session built from those tokens is dead on arrival regardless of which key it is stored under. That skew also produced the
JWT issued at futurerejections PostgREST returned earlier in this work.The fix above is correct on its own terms and verified at the level it can be — the right key is now written. Proving the specs go green needs a machine whose container clock is sane, which is a
docker/Supabase restart, not a code change.What is still needed for the office suite