-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Revert error should not be retried #254
Conversation
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.
This change makes sense. I also checked the other middleware to make sure there wasn't any other place we needed to do this. The fetch
middleware also retries requests, but has an allowlist of retriable errors, and this revert error isn't one of them, so we're good on that (these retriable errors, by the way, are what I think the issue you found is referring to).
Also — and this is just a sidebar — I don't really know why retryOnEmpty
retries errors; based on its name it should only retry empty requests. Unfortunately I don't have enough context on this to know what the right thing to do here is, so it's probably best to leave it alone.
In conclusion, your change makes sense, I just had some tweaks.
Hey @mcmire : I updated the PR and also added unit test coverage. |
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.
Just a few suggestions. Solution looks good aside from this though!
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Hey @mcmire : thanks a lot for review feedbacks, I addressed all of those. |
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!
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1461
This is an issue brought up by blockaid team, in case of revert we should not retry and send back original error.