-
Notifications
You must be signed in to change notification settings - Fork 424
[WIP] feat(clerk-js): Improve getToken offline handling
#7598
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
base: alexbratsos/user-4045-make-gettoken-callable-outside-of-react
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b6350c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| if (ClerkOfflineError.is(e)) { | ||
| throw e; | ||
| } | ||
|
|
||
| if (isNetworkError(e) || !isValidBrowserOnline()) { | ||
| throw new ClerkOfflineError('Network request failed', { | ||
| cause: e instanceof Error ? e : undefined, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we want to happen for all resources, or just the session resource?
|
@bratsos I am concerned that this PR is going to conflict heavily with the stale-while-revalidate change: #7317 I think we will want to base this PR off feat/stale-while-revalidate-token and build on top of it. Some of the offline heuristics work well with SWR since we can return a cached token whenever possible and error only when we truly cannot fetch a new token |
Description
offline-demo.mp4
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change