You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bluebird cancellation semantics are precisely like that. Only operations prior to cancellation are fully aborted: any handlers attached after the cancellation event will be rejected with a cancellation error.
As shown in the example the handlers registered with .finally are called even if the promise is cancelled. Another such exception is .reflect(). No other types of handlers will be called in case of cancellation.
Thus I gather, .catch handlers shouldn't be called neither when registered prior to cancellation (currently they're not), nor when registered after cancellation (currently they are).
Note that it is an error to consume an already cancelled promise, doing such a thing will give you a promise that is rejected with new CancellationError("late cancellation observer") as the rejection reason.
Registering .then to cancelled promise throws, but registering .catch/.finally doesn't. To me this seems inconsistent.
EDIT: scrap that. I read it wrong. Registering late consumers returns a rejected promise rejects them, which explains the behavior with the above console logs (which mute the error). So the behavior is correct 😓
Not only late
catch
/finally
observers are allowed, butcatch
handler shouldn't be called for cancelled promises.v
3.4.0
,FF 46.0.1
,Chrome 50
The text was updated successfully, but these errors were encountered: