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

Change the default of propagateCancel argument in CancelableOperation.then #352

Closed
natebosch opened this issue Mar 22, 2022 · 2 comments · Fixed by dart-archive/async#213

Comments

@natebosch
Copy link
Member

See discussion in dart-archive/async#211 (comment)

I haven't been able to find any tests that fail when I change the default, but it's hard to say for sure if there could be untested behavior.

I'm fairly confident that some of the usage I saw which does not pass the argument would expect cancellation to propagate.

cc @TastyPi - do you recall why you chose not propagating as the default? Do you have any use cases where propagating the cancel would result in incorrect behavior?

cc @lrhn @devoncarew - I'm tempted to try to roll out a change in the default as a minor release. I'm concerned that the unsafe default is going to cause more pain than potentially breaking an existing usage. WDYT?

@devoncarew
Copy link
Member

devoncarew commented Mar 22, 2022

This looks like the only use of CancelableOperation in flutter: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/test/flutter_web_platform.dart#L778. It doesn't look like there's a dep on CancelableOperation.then.

I'm guessing that what we're trying to do here is less about determining whether we should release a breaking change, and more about figuring out whether this is actually breaking (no real uses, nobody relying on the current behavior, ...).

(we may want to in-line some of the comment from dart-archive/async#211 (comment) into here - the google3 impact, ...)

@TastyPi
Copy link
Contributor

TastyPi commented Mar 23, 2022

The original issue is #320, dart-archive/async#81 was a first version which has some possibly relevant discussion, and dart-archive/async#83 is the final pull request. There may have been a discussion internal to Google, but I don't work there anymore so can't check.

The use case for not propagating is if you want to chain multiple then calls off the same operation, and you don't want to cancel everything if you cancel one chain. So the option should probably be kept, but since I don't currently work with Dart I don't care whether the default is changed.

natebosch referenced this issue in dart-archive/async Mar 23, 2022
Closes #212

Authors are more likely to expect propagation, and not cancelling is
often a hidden inefficiency so it often goes unnoticed and untested.

Update the doc comment to focus on the 3 ways an operation can end - as
a value, an error, or a cancellation. This will hopefully make it more
clear that the `onCancel` callback does not relate to the cancellation
of the returned operation.
natebosch referenced this issue in dart-archive/async Mar 28, 2022
Closes #212

Authors are more likely to expect propagation, and not cancelling is
often a hidden inefficiency which may go unnoticed and untested.

Update the doc comment to focus on the 3 ways an operation can end - as
a value, an error, or a cancellation. This will hopefully make it more
clear that the `onCancel` callback does not relate to the cancellation
of the returned operation.
mosuem referenced this issue Oct 14, 2024
Closes dart-lang/async#212

Authors are more likely to expect propagation, and not cancelling is
often a hidden inefficiency which may go unnoticed and untested.

Update the doc comment to focus on the 3 ways an operation can end - as
a value, an error, or a cancellation. This will hopefully make it more
clear that the `onCancel` callback does not relate to the cancellation
of the returned operation.
@mosuem mosuem transferred this issue from dart-archive/async Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants