You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1253b2a
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(expo): drop request abort handling and trim token read tests
The only request clerk-js aborts is the initial client fetch on load
timeout. Its hook already reads a valid token once the app is active,
and fetch rejects the aborted request before it is sent, so threading
the signal through the activation wait is unnecessary.
Share setup across the token read tests, collapse the token cache app
state tables into one, and tighten the changeset wording.
Copy file name to clipboardExpand all lines: .changeset/keychain-read-keeps-client.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
'@clerk/expo': minor
3
3
---
4
4
5
-
Fix iOS users being signed out when the keychain can't be read for a moment, for example when the app is launched in the background before the device has been unlocked since a restart.
5
+
Fix iOS users being signed out when the keychain can't be read for a moment, for example when the app launches in the background before the device has been unlocked since a restart.
6
6
7
-
- On iOS, `getToken()` from the `@clerk/expo/token-cache``tokenCache` now rejects with the keychain error unless the read both starts and fails while the app is active, instead of deleting the stored client token and returning `null`. This also preserves tokens in app extensions. A read that both starts and fails while the app is activestill clears the token, as before.
8
-
- When reading the client token fails, from this `tokenCache` or a custom one, Clerk now waits until the app is active and reads it again before sending the request. If this happens while the app is in the background, those requests wait until the app is opened. If a custom `tokenCache` still fails, the request fails with its error, as before.
9
-
- A custom `tokenCache` that deletes the token and returns `null` whenever a read fails will still sign users out in this situation. To avoid that, rethrow the error unless `AppState.currentState` is `active` both when the read starts and when it fails. A custom `tokenCache` that always rethrows makes Clerk requests fail until the token can be read again.
7
+
- On iOS, `getToken()` from the `tokenCache` in `@clerk/expo/token-cache`no longer deletes the stored client token when the keychain read fails. It rejects with the keychain error instead, which also keeps tokens in app extensions. The one exception is a read that starts and fails while the app is active. That read still deletes the token and returns `null`, as before.
8
+
- When reading the client token fails, from this `tokenCache` or a custom one, Clerk waits until the app is active and reads it once more before sending the request. Requests made in the backgroundwait until the app is opened. If the second read also fails, the request fails with that error.
9
+
- A custom `tokenCache` that deletes the token and returns `null` whenever a read fails still signs users out in this case. To avoid that, rethrow the error unless `AppState.currentState` is `active` both when the read starts and when it fails. A custom `tokenCache` that always rethrows makes Clerk requests fail until the token can be read again.
0 commit comments