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
ChickenChunk
ChickenChunkOP3d ago
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.
garyaustin
garyaustin3d ago
What are your errors when it does not work?
ChickenChunk
ChickenChunkOP3d ago
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
garyaustin
garyaustin3d ago
If you console.log() right after the Supabase call does it return?
garyaustin
garyaustin3d ago
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
ChickenChunk
ChickenChunkOP3d ago
it does not
garyaustin
garyaustin3d ago
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.
ChickenChunk
ChickenChunkOP3d ago
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

Did you find this page helpful?