-
Notifications
You must be signed in to change notification settings - Fork 1
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: support retrying failed requests #8
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
==========================================
+ Coverage 29.25% 31.46% +2.21%
==========================================
Files 9 10 +1
Lines 670 696 +26
==========================================
+ Hits 196 219 +23
- Misses 474 477 +3 ☔ View full report in Codecov by Sentry. |
/no-platform |
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 makes a lot of sense to me!
domain 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.
domain lgtm
📰 Summary of changes
This PR adds support for retrying failed network requests. In short, the following is now possible:
RetryBehavior
"globally" for any request made by theSturdyHttp
instanceRetryBehavior
"locally" for a single request, which takes precedence over theRetryBehavior
of theSturdyHttp
instancedefaultRetryClause
Notable: This implementation does not rely on
Interceptor
s to handle the actual retry logic as I personally have found retry logic viaInterceptor
s to be problematic in the past. This could be changed if we find the implementation as written to not be satisfactory.🧪 Testing done
Unit tests added and passing