Repository navigation
fix(expo): refresh native after a JS change that lands during a native pull - #10431
wobsoriano merged 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 774d3d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…ync-after-sign-in
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
mikepitre
left a comment
There was a problem hiding this comment.
Looks good. Fixes the race the expo e2e runs were hitting, and the regression test fails on main and passes here.
Description
Fixes MOBILE-670. JS sometimes signed in with a ticket at launch while the native
UserButtonstayed empty.Cause
At launch, native emits
clerkNativeClientInvalidatedonce its first client load lands, and JS starts a pull. When the pull ended,fromNativerecorded the current JS fingerprint as already known to native. If the ticket sign-in finished while the pull was in flight, that fingerprint already contained the new session. The nexttoNativesaw an equal fingerprint and skippedrefreshClient(), so native never got the session.Fix
fromNativeno longer setslastFingerprint. OnlytoNativerecords it, right before it refreshes native. A native-originated change now costs one extra native client refresh, which the "settles a native change without an echo loop" test now expects. JS cannot tell which server state native last fetched, so avoiding that refresh without a race would need a native contract change.Verification
The new behavior test signs JS in while a native pull is in flight. It fails on
main(JS onsess_4, native stuck onsess_3) and passes with the fix.To force the race on devices, two throwaway branches added a 2s delay before the pull plus log markers, and ran Expo E2E with
workflow_dispatch.mainwith the delayOpen user profilenot found)clerk.userButton.profilenot found)The Android app log of a failed launch shows the sequence. The pull starts at 52.521, the ticket sign-in lands at 53.329, then the pull ends and both
toNativecalls skip.The iOS run linked in the ticket (10/23) is a different failure. Its home showed
Signed outat the failure, and it predates #10407, which fixed that symptom.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change