Hi,
I'd like to ask for new releases for the middleware crates: reqwest-middleware 0.4.0, reqwest-retry 0.7.0 and reqwest-tracing 0.5.4.
In [uv](https://github.com/astral-sh/uv), we're currently using a git dependency for https://github.com/TrueLayer/reqwest-middleware/pull/159, and we'd like to move to a crates.io dependency (https://github.com/astral-sh/uv/issues/8932).
I've bump reqwest-middleware and reqwest-retry according to being breaking changes in the error type, while requiring reqwest-middleware `>0.3.0, <0.5.0` in reqwest-retry and reqwest-tracing for minimal downstream disruption.
```
error: doc list item missing indentation
Error: --> reqwest-retry/src/middleware.rs:62:4
|
62 | /// `Body`'s `From<String>` or `From<Bytes>` implementations.
| ^
|
= help: if this is supposed to be its own paragraph, add a blank line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
= note: `-D clippy::doc-lazy-continuation` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]`
help: indent this line
|
62 | /// `Body`'s `From<String>` or `From<Bytes>` implementations.
| ++
error: doc list item missing indentation
Error: --> reqwest-retry/src/middleware.rs:65:4
|
65 | /// source directly, avoiding the issue of streaming requests not being clonable.
| ^
|
= help: if this is supposed to be its own paragraph, add a blank line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
|
65 | /// source directly, avoiding the issue of streaming requests not being clonable.
| ++
error: could not compile `reqwest-retry` (lib) due to 2 previous errors
```
* chore: bump minor version for `reqwest-retry`
Breaking change introduced in https://github.com/TrueLayer/reqwest-middleware/pull/155
* chore: bump patch version for `reqwest-middlware`
* fix: `opentelemetry` item in wrong changelog
* chore: bump patch version for `reqwest-tracing`
* update reqwest and http crates
remove task_local_extensions
* remove older opentelemetry packages
* remove more legacy and add new otel
* attempt to make features additive
* features are additive
* delete commented out code
* build split
* docs
* more uniform with reqwest::Client
* remove arcs
* slight optimisation
* update readmes
* update changelog
* Add a generic function to the middleware struct for the `Retryable` decision.
The generic function can be used to define custom behaviour to decide whether to retry a request or not.
By default, this function is `Retryable::from_reqwest_response` which is the same as it was before.
* Add a way to create custom retry policies.
A RetryStrategy will dictate what decision will be made based on the result of the sent request.
* Add RetryableStrategy in the `RetryTransientMiddleware` struct instead of the seperate functions
* Add constructor to create a `RetryTransientMiddleware` with a custom `RetryableStrategy`
* Run `cargo fmt`
* Add example code to the `RetryableStrategy` struct
* Run `cargo fmt`
* Updated changelog
* use a trait
* docs
* include latest changes
Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* refactor: Simplify retry middleware in reqwest.
Removed retry limit:
- Remove MAXIMUM_NUMBER_OF_RETRIES metadata and references in middleware.rs
- Correct mispelling: retry_decision to retry_decision in middleware.rs
- Update Retryable matching to only match Retryable::Transient in middleware.rs
- Simplify branching by removing n_past_retries < MAXIMUM_NUMBER_OF_RETRIES condition in middleware.rs
* test: Remove retry cap assertion from test file
remove retry limit assertion test
* feat: wasm32-unknown-unknown support
This replaces task-local-extensions with http's extensions, as http was
already in the dependency closure anyway and the other features of
task-local-extensions (that required an incompatible-with-wasm part of
tokio) were not used anyway.
* feat: have ci check that wasm32-unknown-unknown keeps compiling
* revert back to task-local-extensions
* fix ci
* fix random on wasm
* fix ci again
* bump
---------
Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
* (cargo-release) reqwest-middleware version 0.1.5
* (cargo-release) reqwest-retry version 0.1.4
* (cargo-release) reqwest-tracing version 0.2.1
* (cargo-release) reqwest-middleware start next development iteration 0.1.6-alpha.0
* (cargo-release) reqwest-retry start next development iteration 0.1.5-alpha.0
* (cargo-release) reqwest-tracing start next development iteration 0.2.2-alpha.0
* Updated CHANGELOGS for 0.1.4 and 0.1.5