-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(client): correct clock skew from any response #11503
fix(client): correct clock skew from any response #11503
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #11503 +/- ##
==========================================
- Coverage 83.24% 83.24% -0.01%
==========================================
Files 274 274
Lines 20565 20559 -6
Branches 4447 4444 -3
==========================================
- Hits 17120 17114 -6
Misses 3157 3157
Partials 288 288
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
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.
Looks good, thanks @AllanZhengYP 🏅
Description of changes
Currently only in Pinpoint client, we use signing middleware to keep track of clock offset between local clock and server clock. The current implementation incorrectly assumes the error responses are already parsed to JavaScript errors and thrown from
next
handler. However this is not true for signing middleware. Because it's applied always after the retry middleware, the HTTP responses regardless of status code are returned from thenext
handler.The signing middleware after this change, maintain the offset for both successful or fail HTTP response.
Description of how you validated changes
Manually validated.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.