You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Causing an auth event raises NotConnectedError because realtime.connect() isn't called beforehand.
For example, trying to Sign up a user through supabase.auth.sign_up(credentials) makes gotrue notify subscribers of the event. Supabase listens for the event and tries to run set_auth() without connecting and then crashes the application.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Initialize a supabase client
Try signing up a new user
Client tries to run self.realtime.set_auth(access_token) without calling self.realtime.connect() first
NotConnectedError gets raised
Expected behavior
A new user should be created without rising any errors
Screenshots
If applicable, add screenshots to help explain your problem.
System information
OS: [e.g. macOS, Windows]
Browser (if applies) [e.g. chrome, safari]
Version of supabase-js: [e.g. 6.0.2]
Version of Node.js: [e.g. 10.10.0]
Traceback
File "/mnt/c/Users/Jacob/Documents/GitHub/user-api/app/api/auth.py", line 44, in signup_user
session = settings.supabase.auth.sign_up(credentials.model_dump()).session
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/slumby/.local/share/virtualenvs/user-api-Jy_0pb3R/lib/python3.12/site-packages/gotrue/_sync/gotrue_client.py", line 237, in sign_up
self._notify_all_subscribers("SIGNED_IN", response.session)
File "/home/slumby/.local/share/virtualenvs/user-api-Jy_0pb3R/lib/python3.12/site-packages/gotrue/_sync/gotrue_client.py", line 991, in _notify_all_subscribers
subscription.callback(event, session)
File "/home/slumby/.local/share/virtualenvs/user-api-Jy_0pb3R/lib/python3.12/site-packages/supabase/_sync/client.py", line 300, in _listen_to_auth_events
self.realtime.set_auth(access_token)
File "/home/slumby/.local/share/virtualenvs/user-api-Jy_0pb3R/lib/python3.12/site-packages/realtime/_sync/client.py", line 30, in wrapper
raise NotConnectedError(func.__name__)
realtime.exceptions.NotConnectedError: A WS connection has not been established. Ensure you call RealtimeClient.connect() before calling RealtimeClient.set_auth()
The text was updated successfully, but these errors were encountered:
I tried jankily adding one line locally that runs realtime.connect() which seemed to solve the issue on supabase's side (realtime then causes an AttributeError for which i've also opened an issue) but I'm sure that this is doomed to happen to others so I come to you to see if this is in fact an accident or if it turns out my project needs to be adapted (I couldn't find anything in the documentation regarding this)
Bug report
Describe the bug
Causing an auth event raises NotConnectedError because realtime.connect() isn't called beforehand.
For example, trying to Sign up a user through supabase.auth.sign_up(credentials) makes gotrue notify subscribers of the event. Supabase listens for the event and tries to run set_auth() without connecting and then crashes the application.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
A new user should be created without rising any errors
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Traceback
The text was updated successfully, but these errors were encountered: