Missing super.cancel() call in AsyncOperation.cancel()

If my understanding is right, the value of isCanceled will never be true without calling super.cancel().

@ihsan That was a mistake in the early access book that is fixed in the version just released. You should not override the cancel method at all. When you call cancel the only change is that the isCanelled flag is set to true. It’s still up to your code whether or not you honor that flag.

You definitely should not set the state to .finished when cancel is called because the operation is not in fact finished at that point.

Sorry for the confusion!

1 Like