machty / ember-concurrency

ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
http://ember-concurrency.com
MIT License
691 stars 155 forks source link

Cast Yieldables to promises when using cancelable promise helpers #427

Closed maxfierke closed 3 years ago

maxfierke commented 3 years ago

Bug found in #413

Yieldables themselves can be triggered multiple times and return a different promise everytime they're casted, which Promise/RSVP.all, allSettled, race, etc. will do internally, but prevents collecting the disposer to use for cancelation. This effectively neutralizes cancellation, which is not what we want, so we need to cast it before handing it off to the Promise/RSVP implementation.