Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes introduced?
Addresses ENG-10894
The Storefront SDK wasn't retrying on certain network errors like
ETIMEDOUT
.What is this pull request doing?
This PR updates the default urql request retry configuration so that retries happen in response to any network error. Previously, retries only happened in response to certain HTTP error statuses. This made it difficult to respond to transient network issues like
ETIMEDOUT
.This PR also adds a couple of new unit tests to achieve 100% coverage.
How to Test
End to end
This is a tough PR to test end-to-end. Instead of asking reviewers to follow steps, I'll provide my own testing results.
In a fresh project, I used
nock
to simulate anETIMEDOUT
error. I then added some logging to theretryIf
configuration innode_modules/@nacelle/storefront-sdk/dist/nacelle-storefront-sdk.js
. I made a content request and saw that theETIMEDOUT
led to the expected number of retries (5):Unit tests
ENG-10894/storefront-sdk-retry-on-all-network-errors
branchpackages/storefront-sdk
npm run build
- it should build without errorsnpm run coverage
- all tests should pass with 100% coverageChecklist
nacelle-js
' Code of Conduct.