-
Notifications
You must be signed in to change notification settings - Fork 26k
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): in TaskTrackingZoneSpec track a periodic task until it is cancelled #45391
Conversation
2e36dde
to
6766dd1
Compare
Hi @JiaLiPassion. Thanks for reviewing the PR. Can you help me confirm this PR is a "breaking change" for zone.js and/or even Angular packages? This PR changes a behavior of
|
…is cancelled Before this change, the macrotask for `setInterval(callback, ms)` was no longer tracked by `TaskTrackingZoneSpec` after the `callback` was invoked for the first time. Now the periodic macrotask is tracked until it is cancelled, e.g. `clearInterval(id)`. BREAKING CHANGE: in TaskTrackingZoneSpec track a periodic task until it is cancelled The breaking change is scoped only to the plugin `zone.js/plugins/task-tracking`. If you used `TaskTrackingZoneSpec` and checked the pending macroTasks e.g. using `(this.ngZone as any)._inner ._parent._properties.TaskTrackingZone.getTasksFor('macroTask')`, then its behavior slightly changed for periodic macrotasks. For example, previously the `setInterval` macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g with `clearInterval(id)`. fixes 45350
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@AndrewKushnir , could you help me to run a global presubmit to check whether this PR impact the g3
? Thank you.
@JiaLiPassion FYI the global presubmit went well, no broken/failing targets. Please add the "merge" label is there are no additional changes expected in this PR. |
@AndrewKushnir , got it, thank you. |
This PR was merged into the repository by commit f19b36f. |
…is cancelled (angular#45391) Before this change, the macrotask for `setInterval(callback, ms)` was no longer tracked by `TaskTrackingZoneSpec` after the `callback` was invoked for the first time. Now the periodic macrotask is tracked until it is cancelled, e.g. `clearInterval(id)`. BREAKING CHANGE: in TaskTrackingZoneSpec track a periodic task until it is cancelled The breaking change is scoped only to the plugin `zone.js/plugins/task-tracking`. If you used `TaskTrackingZoneSpec` and checked the pending macroTasks e.g. using `(this.ngZone as any)._inner ._parent._properties.TaskTrackingZone.getTasksFor('macroTask')`, then its behavior slightly changed for periodic macrotasks. For example, previously the `setInterval` macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g with `clearInterval(id)`. fixes 45350 PR Close angular#45391
…is cancelled (angular#45391) Before this change, the macrotask for `setInterval(callback, ms)` was no longer tracked by `TaskTrackingZoneSpec` after the `callback` was invoked for the first time. Now the periodic macrotask is tracked until it is cancelled, e.g. `clearInterval(id)`. BREAKING CHANGE: in TaskTrackingZoneSpec track a periodic task until it is cancelled The breaking change is scoped only to the plugin `zone.js/plugins/task-tracking`. If you used `TaskTrackingZoneSpec` and checked the pending macroTasks e.g. using `(this.ngZone as any)._inner ._parent._properties.TaskTrackingZone.getTasksFor('macroTask')`, then its behavior slightly changed for periodic macrotasks. For example, previously the `setInterval` macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g with `clearInterval(id)`. fixes 45350 PR Close angular#45391
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Before this change, the macrotask for
setInterval(callback, ms)
was nolonger tracked by
TaskTrackingZoneSpec
after thecallback
wasinvoked for the first time. Now the periodic macrotask is tracked until
it is cancelled, e.g.
clearInterval(id)
.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #45350
Before this change, the macrotask for
setInterval(callback, ms)
was nolonger tracked by
TaskTrackingZoneSpec
after thecallback
wasinvoked for the first time.
What is the new behavior?
Now the periodic macrotask is tracked by
TaskTrackingZoneSpec
untilthe task is cancelled, e.g.
clearInterval(id)
.Does this PR introduce a breaking change?
The breaking change is scoped only to the plugin
zone.js/plugins/task-tracking
. If you usedTaskTrackingZoneSpec
and checked the pending macroTasks e.g. using(this.ngZone as any)._inner._parent._properties.TaskTrackingZone.getTasksFor('macroTask')
, then its behavior slightly changed for periodic macrotasks. For example, previously thesetInterval
macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g withclearInterval(id)
.