Skip to content

Conversation

@filipecabaco
Copy link
Member

What kind of change does this PR introduce?

prevent async calls in _listenForAuthEvents ( https://supabase.com/docs/reference/javascript/auth-onauthstatechange )

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14973934667

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-3.7%) to 63.902%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SupabaseClient.ts 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
src/SupabaseClient.ts 2 59.43%
Totals Coverage Status
Change from base Build 14972871272: -3.7%
Covered Lines: 98
Relevant Lines: 130

💛 - Coveralls

@filipecabaco filipecabaco merged commit 998bb68 into next May 12, 2025
2 checks passed
@filipecabaco filipecabaco deleted the fix/timeout-on-listen-for-auth-events branch May 12, 2025 14:06
grdsdev added a commit that referenced this pull request May 20, 2025
* fix: Bump up realtime; add integration tests (#1395)

* fix: bump up realtime-js (#1409)

* fix: bump up realtime-js; await on token change (#1411)

* fix: prevent async calls in _listenForAuthEvents (#1412)

* fix: bump up realtime-js (#1413)

* bump up realtime-js (#1419)

* resolve conflict

---------

Co-authored-by: Guilherme Souza <guilherme@supabase.io>
Co-authored-by: Guilherme Souza <ogrsouza@gmail.com>
@Snehil-Shah
Copy link

@filipecabaco I'd presume this eliminates the need for the hack to avoid deadlocks as mentioned in the docs, right?

@filipecabaco
Copy link
Member Author

can you be more specific?

@Snehil-Shah
Copy link

@filipecabaco The docs (here) mention that awaiting async supabase functions inside the callback can cause a deadlock, and recommends dispatching it after the callback ends, as a hack. Does this PR fix that?

@filipecabaco
Copy link
Member Author

That still needs to be avoided as this only fixed in this specific scenario and not fully as this flow really should not be async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants