-
Notifications
You must be signed in to change notification settings - Fork 26
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
[Feat][DEVX-548]Add Retry for (401) Invalid Token Error #950
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c25a7a5 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 |
packages/platform-sdk/test/integration-tests/sdk-v3/error-cases.test.ts
Dismissed
Show dismissed
Hide dismissed
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #950 +/- ##
==========================================
+ Coverage 96.73% 97.19% +0.45%
==========================================
Files 112 113 +1
Lines 2145 2104 -41
Branches 633 605 -28
==========================================
- Hits 2075 2045 -30
+ Misses 63 52 -11
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Good Job! 👍 |
There is no API change hence there is nothing to update, besides, the github pages is automated and will be publish on the next release. |
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.
Great job! I just some small comments 👍
packages/platform-sdk/test/integration-tests/sdk-v3/error-cases.test.ts
Outdated
Show resolved
Hide resolved
packages/sdk-client-v3/src/middleware/auth-middleware/auth-request-processor.ts
Outdated
Show resolved
Hide resolved
packages/sdk-client-v3/src/middleware/auth-middleware/auth-request-processor.ts
Outdated
Show resolved
Hide resolved
- add a 401 status check in auth middleware - move token processor to an authProcessor function - refactor code to remove duplicate logic - add integration tests
- use correct token expiry time
- add more tests to improve coverage
- add more tests to improve coverage
- add more tests to improve coverage
- add more tests to improve coverage
- add more tests to improve coverage
- rename function from _tokenCache to tokenStore
…uest-processor.ts Co-authored-by: Lam Tran <[email protected]>
7ee31ff
to
f637028
Compare
- use concise and meaningful function names - parallelize Promise function for simulating conconcurrency
f637028
to
c25a7a5
Compare
Yes, I know that there isn't any API change, what I mean is that if this method could be used by the customer, please remember to update the official documentation. |
Summary
Add retry for (401) invalid token
Completed Tasks
Background 📚
In rare cases, a token may become invalid on the server side while still being present on the client, either in the
Authorization header
or thetokenCache
.This PR addresses this edge case by ensuring that the client application always has a valid token.