Sitelet https://web.archive.org/web/20220712012120/https://github.com/angular/angular/pull/46435
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

fix(zone.js): cancel tasks only when they are scheduled or running #46435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arturovt
Copy link
Contributor

@arturovt arturovt commented Jun 20, 2022

Currently, there's no check if the task (that is being canceled) has the right state.
Only scheduled and running tasks can be canceled. If the task has a non-appropriate
state, then an error will be thrown. Cancelation should not throw an error on an already
canceled task, e.g. clearTimeout does not throw errors when it's called multiple times
on the same timer.

  • Bugfix

Issue Number: #45711

Does this PR introduce a breaking change?

  • Yes
  • No

@pullapprove pullapprove bot requested a review from JiaLiPassion Jun 20, 2022
@ngbot ngbot bot added this to the Backlog milestone Jun 20, 2022
@ngbot ngbot bot added this to the Backlog milestone Jun 20, 2022
Currently, there's no check if the task (that is being canceled) has the right state.
Only `scheduled` and `running` tasks can be canceled. If the task has a non-appropriate
state, then an error will be thrown. Cancelation should not throw an error on an already
canceled task, e.g. `clearTimeout` does not throw errors when it's called multiple times
on the same timer.

PR Close angular#45711
@arturovt arturovt changed the title fix(zone.js): cancel the task when it has the right state fix(zone.js): cancel tasks only when they are scheduled or running Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants