Skip to content
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

Fix streamed response cancellation and progress #2068

Merged
merged 9 commits into from
Dec 22, 2023

Conversation

kuhnroyal
Copy link
Member

@kuhnroyal kuhnroyal commented Dec 17, 2023

This is a new approach that handles both IO & HTTP/2 adapters.
I also moved the receiveTimeout handling for IO & HTTP2 to the new helper.

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

@kuhnroyal kuhnroyal self-assigned this Dec 17, 2023
@kuhnroyal kuhnroyal requested a review from a team as a code owner December 17, 2023 22:40
@kuhnroyal
Copy link
Member Author

The failing tests happen with the Http2Adapter on the 2.15.0 SDK. Not sure what is going on.
http2 2.1+ requires Dart 3.0.0 anyways. So I think we should bump the min SDK for dio_http2_adapter.

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome. But I'm still confused by the changes of http2, from our changes it shouldn't cause the min check to fail.

plugins/http2_adapter/test/utils.dart Outdated Show resolved Hide resolved
dio/CHANGELOG.md Show resolved Hide resolved
@kuhnroyal
Copy link
Member Author

But I'm still confused by the changes of http2, from our changes it shouldn't cause the min check to fail.

Yea, I am still not sure what the problem is.

@kuhnroyal
Copy link
Member Author

This was the failing run: https://github.com/cfug/dio/pull/2068/checks?check_run_id=19725552125
It was one of the new cancellation tests failing. The changes to the HTTP2 adapter are pretty basic so it has to be caused by some of the stream handling changes. But since it works in newer SDKs, I don't know where to start looking and also not sure it is worth the time.

@AlexV525 AlexV525 added s: feature This issue indicates a feature request p: dio Targeting `dio` package p: http2_adapter Targeting `http2_adapter` package s: bug Something isn't working platform: io labels Dec 22, 2023
Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@kuhnroyal kuhnroyal added this pull request to the merge queue Dec 22, 2023
Merged via the queue into cfug:main with commit 845e06f Dec 22, 2023
3 checks passed
@kuhnroyal kuhnroyal deleted the feature/cancel-stream-2 branch December 22, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: dio Targeting `dio` package p: http2_adapter Targeting `http2_adapter` package platform: io s: bug Something isn't working s: feature This issue indicates a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make CancelToken be able to cancel response streams from ResponseType.stream requests
2 participants