Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Supabase operations in onAuthStateChange will cause the next call to supabase anywhere else in the code to not return.Β #762

@izhan

Description

@izhan

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

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

  1. Sign into an application with Supabase auth running
  2. Wait an hour (or however long it takes for your token to expire)
  3. Reload the page and call await supabase.auth.getSession()
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions