-
Notifications
You must be signed in to change notification settings - Fork 351
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
Make StreameRequest.sink a StreamSink #965
Conversation
Closes #727 This class was not designed for extension, but there is at least one extending implementation. I don't see any overrides of this field, so no existing usage should be broken.
Ah interesting, this causes new |
Yeah, this change is technically breaking. If we assume that it is non-breaking because no one implements this class then you could change it to |
pkgs/http/test/io/client_test.dart
Outdated
..sink.add('{"hello": "world"}'.codeUnits) | ||
..sink.close(); | ||
request.sink.add('{"hello": "world"}'.codeUnits); | ||
await request.sink.close(); |
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.
None of the awaits in the tests are necessary, right? Otherwise this would be a breaking change.
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.
Only necessary for lints - although it looks like adding the await
can be breaking, so we may want to reconsider the risk of this change. It would be safe to use unawaited()
exclusively instead.
@@ -32,7 +32,7 @@ class StreamedRequest extends BaseRequest { | |||
/// buffered. | |||
/// | |||
/// Closing this signals the end of the request. | |||
EventSink<List<int>> get sink => _controller.sink; | |||
StreamSink<List<int>> get sink => _controller.sink; |
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.
I think that you need to update the example in the documentation for this class.
cc @jakemac53 - this change isn't directly breaking, but with a typical linting setup that uses |
Prefix all lines of the commment-in-example-in-comment with `//`. Fix grammar. Remove "generally". Remove redundant mention of the not completing future - it's more clear to state it above the `unawaited` in the example code.
Closes #727
This class was not designed for extension, but there is at least one
extending implementation. I don't see any overrides of this field, so no
existing usage should be broken.