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

Disconnected promise chains for cancellation #1650

Open
jmwilkinson opened this issue Jul 8, 2020 · 1 comment
Open

Disconnected promise chains for cancellation #1650

jmwilkinson opened this issue Jul 8, 2020 · 1 comment

Comments

@jmwilkinson
Copy link

jmwilkinson commented Jul 8, 2020

Please answer the questions the best you can:

  1. What version of bluebird is the issue happening on?

3.7.2

  1. What platform and version? (For example Node.js 0.12 or Google Chrome 32)

Node.js 10.x

  1. Did this issue happen with earlier version of bluebird?

Unknown

(Write description of your issue here, stack traces from errors and code that reproduces the issue are helpful)

The docs on cancellation state:

As an optimization, the cancellation signal propagates upwards the promise chain so that an ongoing operation e.g. network request can be aborted.

There seems to be no way to prevent the propagation- that is, if a child promise is cancelled, there is no way for the parent calling promise to continue.

This can be restrictive.

Perhaps there could be a function added like noCancelPropagation() that would cause only the initial promise to be cancelled.

@spion
Copy link
Collaborator

spion commented Jul 9, 2020

You can create and keep a second fork of that promise (using then) and the cancellation should be unable to propagate past that point unless the fork also cancels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants