Insanely Annoying Bug
There is a bug I have noticed in my app that whenever you leave the tab, then come back, you can no longer do any update/delete/insertions. Its really annoying, has anyone experienced this or know any potential causes? Please help thank you
8 Replies
the functions will work forever if you do not leave the page, this is on the deployment version, additionally if you refresh the page things will work as normal again.
What are your errors when it does not work?
There is no error besides a timeout, i click my 'update item' button but the button is reacting and changing the text to 'saving'. I think it for some reason cannot establish a connection to the database after leavin the tab but i dont see why that would happen or how to fix it
actually it doesnt even timeout i didnt add one
If you console.log() right after the Supabase call does it return?
It is likely this important note here: https://supabase.com/docs/reference/javascript/auth-onauthstatechange
If you have onAuthStateChange
JavaScript: Listen to auth events | Supabase Docs
Supabase API reference for JavaScript: Listen to auth events
it does not
If you are using the handler then you likely have a call in it that deadlocks your normal calls. There is an auth event when you come back from a tab change.
You got it exactly there was an async call in my onauthstatechange i removed which fixed it. thank you so much this has been annoying me for weeks