diff --git a/.changeset/soft-poems-repeat.md b/.changeset/soft-poems-repeat.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/soft-poems-repeat.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx b/packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx index 3289e535f5c..ee2ff2a4d60 100644 --- a/packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx +++ b/packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx @@ -1564,6 +1564,11 @@ describe('ClerkProvider native client sync', () => { expect(mocks.clerkInstance.handleUnauthenticated).not.toBe(originalHandleUnauthenticated); }); + // Bootstrap's suppressed device token write would swallow the rotation below. + await act(async () => { + await waitForPendingJsToNativeSync(); + }); + // Drop the client fetches the bootstrap already made; only the 401 handling matters here. fetchClient.mockClear(); @@ -1618,6 +1623,11 @@ describe('ClerkProvider native client sync', () => { expect(mocks.clerkInstance.handleUnauthenticated).not.toBe(originalHandleUnauthenticated); }); + // Bootstrap fetches the client too, and that fetch fails here, so drain its retries first. + await act(async () => { + await expect(waitForPendingJsToNativeSync()).rejects.toThrow('stale session 401'); + }); + fetchClient.mockClear(); await act(async () => {