Title: fix(zone.js): setTimeout patch should clean tasksByHandleId cache by JiaLiPassion · Pull Request #40586 · angular/angular · GitHub
Open Graph Title: fix(zone.js): setTimeout patch should clean tasksByHandleId cache by JiaLiPassion · Pull Request #40586 · angular/angular
X Title: fix(zone.js): setTimeout patch should clean tasksByHandleId cache by JiaLiPassion · Pull Request #40586 · angular/angular
Description: Close #40387 Currently zone.js patches setTimeout and keeps a tasksByHandleId map to keep timerId <-> ZoneTask relationship. This is needed so that when clearTimeout(timerId) is called, zone.js can find the associated ZoneTask. Now zone.js set the tasksByHandleId map in the scheduleTask function, but if the setTimeout is running in the FakeAsyncZoneSpec or any other ZoneSpec with onScheduleTask hooks. The scheduleTask in timer patch may not be invoked. For example: fakeAsync(() => { setTimeout(() => {}); tick(); }); In this case, the timerId kept in the tasksByHandleId map is not cleared. This is because the FakeAsyncZoneSpec in the onScheduleTask hook looks like this. onScheduleTask(delegate, ..., task) { fakeAsyncScheduler.setTimeout(task); return task; } Because FakeAsyncZoneSpec handles the task itself and it doesn't call parentDelegate.onScheduleTask, therefore the default scheduleTask in the timer patch is not invoked. In this commit, the cleanup logic is moved from scheduleTask to setTimeout patch entry to avoid the memory leak.
Open Graph Description: Close #40387 Currently zone.js patches setTimeout and keeps a tasksByHandleId map to keep timerId <-> ZoneTask relationship. This is needed so that when clearTimeout(timerId) is called, zone....
X Description: Close #40387 Currently zone.js patches setTimeout and keeps a tasksByHandleId map to keep timerId <-> ZoneTask relationship. This is needed so that when clearTimeout(timerId) is calle...
Opengraph URL: https://github.com/angular/angular/pull/40586
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a9e9ab26-bf00-b6f1-5bf5-dfca4a942a75 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC92:14FE3E:4B18C:69FFB:6A59CDB4 |
| html-safe-nonce | d0bbd6f26e49d86614383b7043146144914012059be2b532fc638d057a9d394b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzkyOjE0RkUzRTo0QjE4Qzo2OUZGQjo2QTU5Q0RCNCIsInZpc2l0b3JfaWQiOiI1MDMyNTY1MjMyOTM5NjgzMjUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 259eff7ab3d9220f9d96e426c1b5c99dd21af7dad2bfff99f0edc4ad4ed4be25 |
| hovercard-subject-tag | pull_request:562175443 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/40586/files |
| twitter:image | https://avatars.githubusercontent.com/u/1442575?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1442575?s=400&v=4 |
| og:image:alt | Close #40387 Currently zone.js patches setTimeout and keeps a tasksByHandleId map to keep timerId <-> ZoneTask relationship. This is needed so that when clearTimeout(timerId) is called, zone.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab680789ae4a316cdaf0d5a292a1760140931cc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width