I've been struggling a bit still with some token refresh issues in a React Native app. The general challenge is when the app opens from cold start or from background, sometimes there is a delay in user being available (either because a token expired in background, or just because of AsyncStorage being... async), which leads to us showing a login screen briefly. I saw the comment here:
> So at a minimum anyone using a visibility handler needs to check for token refreshed before executing an SB RLS call.
https://github.com/supabase/gotrue-js/pull/278/#issuecomment-1120604232
which just raised the question for me – how would we reliably make sure we have the refreshed user/session from the auth client before making RLS calls? other than just adding an arbitrary delay?