Bug report
Describe the bug
await supabase.auth.getSession() will hang indefinitely every hour or so, until the user reloads the page. We suspect it's related to the token needing to be refreshed.
To Reproduce
- Sign into an application with Supabase auth running
- Wait an hour (or however long it takes for your token to expire)
- Reload the page and call
await supabase.auth.getSession()
getSession will hang indefinitely
It's unclear right now whether (4) happens all the time or only some of the time. But we've been managing to reproduce pretty frequently, both locally and in prod. It's been affecting our customers as well.
Reloading the browser after (4) will immediately resolve the issue. Subsequent reloads will be fine, until an hour of inactivity in which this problem occurs again.
We've tried multiple versions of supabase-js and gotrue already, to no effect. This has been occurring for the past few weeks.
supabase/supabase#15930 seems related but that ticket seems to be concerned with immediately after Google OAuth. Our problem occurs well after initial login.
Expected behavior
We expect getSession to never hang indefinitely
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows] macOS
- Browser (if applies) [e.g. chrome, safari] Chrome
- Version of supabase-js: [e.g. 6.0.2] Multiple (2.24, 2.26, 2.31)
- Version of Node.js: [e.g. 10.10.0] v18.16.0
Additional context
We tried this on multiple versions of supabase-js (2.24, 2.26, 2.31) and gotrue (2.42, 2.43.1, 2.46.1)