Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expo] Supabase Auth Fails After Expo OTA Update IOS #1367

Open
2 tasks done
NoRoboto opened this issue Jan 29, 2025 · 0 comments
Open
2 tasks done

[expo] Supabase Auth Fails After Expo OTA Update IOS #1367

NoRoboto opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@NoRoboto
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

After applying an Expo OTA (Over-the-Air) update, Supabase authentication fails.

  • Session persistence works fine when the app is closed and reopened normally.
  • However, after running await Updates.reloadAsync(), the session cannot be restored automatically or manually using stored tokens.
  • The error returned is: Network request failed - AuthRetryableFetchError

To Reproduce

  1. Initialize Supabase with:
import AsyncStorage from '@react-native-async-storage/async-storage';

const supabaseInstance = createClient<Database>(supabaseUrl, supabaseAnonKey, {
  auth: {
    storage: AsyncStorage,
    autoRefreshToken: true,
    persistSession: true,
    detectSessionInUrl: false,
  },
});
  1. Run an OTA update using await Updates.reloadAsync();
  2. Observe that Supabase cannot restore the session.
  3. as a workaround I tried to trigger the authentication manually by retrieving the session tokens, without success.
const { data, error } = await supabase.auth.setSession({
      access_token: tokens.access_token,
      refresh_token: tokens.refresh_token,
    });

or any other subsequent supabase call yields this error: Network request failed - AuthRetryableFetchError

The same tokens work correctly if not OTA downloaded.

Expected behavior

The session should persist across OTA updates, just like it does when the app is closed and reopened normally.

Screenshots

System information

  • OS: macOS
  • Our app is only for IOS, we do not have support for android yet.
  • "react-native": "0.76.5"
  • "@supabase/supabase-js": "^2.43.5"
@NoRoboto NoRoboto added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant