fix: update the retry function to check the response status correctly #754
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.
This PR fixes the function that retries requests when a rate limit is hit. This bug was already present in the past and somebody tried to fix it in the #732 but that didn't seem the solution.
Pull request type
Jira Link: INT-
How to test this PR
You need to test this both in Node and client-side.
Node.js
In the
playground/index-node.js
put the content below and then runnode playground/index-node
.Client-side
In the
playground/main.ts
add the code below, then run in the consolenpm run demo
and in your browser refresh the page of the demo until you see the retry message in the console.What is the new behavior?
Once a rate limit is hit the retry mechanism is executed and the console will show the message "Hit rate limit. Retrying in X seconds."
Other information