You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use SSE in forc-publish for long-running uploads (#7178)
This pull request introduces changes to enhance the functionality of the
`forc-publish` plugin, including improvements to error handling, support
for streaming server responses, and updates to dependencies. The most
significant changes include adding a new error variant, updating the
`upload` method to handle streaming responses, and modifying
dependencies to include `futures-util` and additional features for
`reqwest`.
### Enhancements to Error Handling:
* Added a new `ServerError` variant to the `Error` enum in
`forc-plugins/forc-publish/src/error.rs` to handle server-related
errors.
### Improvements to `upload` Method:
* Updated the `upload` method in `forc-publish/src/forc_pub_client.rs`
to process streaming server responses using `futures-util::StreamExt`.
This includes handling chunked data, parsing JSON responses, and
printing event updates.
[[1]](diffhunk://#diff-c706a808124a73081593a5e34fb999aa1a446f97d97da1657ddb4b3c55d24371R43)
[[2]](diffhunk://#diff-c706a808124a73081593a5e34fb999aa1a446f97d97da1657ddb4b3c55d24371L53-R97)
### Dependency Updates:
* Added `futures-util` as a dependency in `Cargo.toml` and
`forc-plugins/forc-publish/Cargo.toml` to support streaming operations.
[[1]](diffhunk://#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R157)
[[2]](diffhunk://#diff-2bd34a7b1fa0f1850ad25c6e080d410b2df98c16b6cd75445a138d04e617311aL16-R17)
* Enabled the `stream` feature for `reqwest` in
`forc-plugins/forc-publish/Cargo.toml` to facilitate streaming server
responses.
### Minor Adjustments:
* Added empty `println!` calls in `main.rs` to improve output formatting
during error handling and publishing operations.
[[1]](diffhunk://#diff-2c9e261f1e02238f33a9403387f40481b5b372475c0de3782146b614210675b3R32)
[[2]](diffhunk://#diff-2c9e261f1e02238f33a9403387f40481b5b372475c0de3782146b614210675b3R52)

0 commit comments