https://supabase.com/ logo
#help
Title
# help
s

solidsnail

05/20/2022, 1:21 PM
Hi, why is onAuthStateChange getting triggered on browser tab focus ? Is this intentional ?
n

Needle

05/20/2022, 1:21 PM
Hello @solidsnail! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g

garyaustin

05/20/2022, 2:07 PM
This is a side effect of a fix they made to gotrue.js to handle refreshing the token when coming back from background tab where it might not run. I mentioned this in the pull request was something that might cause issues or confusion as the code generates the signin whether the token needed refreshing or not. The pull request: https://github.com/supabase/gotrue-js/pull/278#issuecomment-1121825720 You might add to this bug report if interested. https://github.com/supabase/gotrue-js/issues/284
n

Needle

05/20/2022, 2:07 PM
solidsnail (2022-05-20)
s

solidsnail

05/20/2022, 2:12 PM
Ah I see @garyaustin According to the comment I sense that the fix should be done by the user with a workaround
But what I don't get is that they already have REFRESH_TOKEN event
so logically recovering the session should be done on REFRESH_TOKEN and has nothing to do with SIGNED_IN event
I'll just add your workaround until they fix this issue, thanks a lot
g

garyaustin

05/20/2022, 2:17 PM
I have recommended they not have any event if token is still good, just the refresh, signin combo they normally do if it is expired.
s

solidsnail

05/20/2022, 2:30 PM
Yeah that's how it should be normally
n

Needle

05/20/2022, 3:27 PM
Thread was archived by @solidsnail. Anyone can send a message to unarchive it.