Title: Zone.js does not properly handle AbortSignal in addEventListener · Issue #49591 · angular/angular · GitHub
Open Graph Title: Zone.js does not properly handle AbortSignal in addEventListener · Issue #49591 · angular/angular
X Title: Zone.js does not properly handle AbortSignal in addEventListener · Issue #49591 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No Description Zone.js tries to be clever and creates a single handler for all listeners to the same event on the same target that have the same capture...
Open Graph Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No Description Zone.js tries to be clever and creates a single handler for all listeners to the same event on th...
X Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No Description Zone.js tries to be clever and creates a single handler for all listeners to the same event on th...
Opengraph URL: https://github.com/angular/angular/issues/49591
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Zone.js does not properly handle AbortSignal in addEventListener","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nzone.js\n\n### Is this a regression?\n\nNo\n\n### Description\n\nZone.js tries to be clever and creates a single handler for all listeners to the same event on the same target that have the same `capture` setting.\r\n\r\nHowever, with the somewhat recent addition of the `signal` setting, this means that handlers can improperly registered, consider the following two tests:\r\n\r\n```javascript\r\nconst controller = new AbortController();\r\nwindow.addEventListener('myEvent', () =\u003e console.log('expected'));\r\nwindow.addEventListener('myEvent', () =\u003e console.log('unexpected'), {signal: controller.signal});\r\ncontroller.abort();\r\nwindow.dispatchEvent(new Event('myEvent'));\r\n// LOG: 'expected'\r\n// LOG: 'unexpected'\r\n```\r\n\r\n```javascript\r\nconst controller = new AbortController();\r\nwindow.addEventListener('myEvent', () =\u003e console.log('unexpected'), {signal: controller.signal});\r\nwindow.addEventListener('myEvent', () =\u003e console.log('expected'));\r\ncontroller.abort();\r\nwindow.dispatchEvent(new Event('myEvent'));\r\n// nothing logs\r\n```\r\n\r\nIf zone.js is not installed, only `'expected'` is logged in each case.\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n_No response_\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/DavidANeil","@type":"Person","name":"DavidANeil"},"datePublished":"2023-03-25T09:29:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/49591/angular/issues/49591"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:219f4227-7329-d164-dc22-ea1dcbd5df72 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC38:19CD0D:1AB0960:23CD1CA:6A5BC28C |
| html-safe-nonce | 3cf86c43eb6a0c41a131b4c4c6a8e24440285beca565727873eaec2995b3fc2a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzM4OjE5Q0QwRDoxQUIwOTYwOjIzQ0QxQ0E6NkE1QkMyOEMiLCJ2aXNpdG9yX2lkIjoiNjA1MzU3NTcxNjIyMjI1NTc1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1c26866d052f43a199f6e4ecd440adb50a8200e5e4826e5a4497750e2c435474 |
| hovercard-subject-tag | issue:1640448934 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/angular/angular/49591/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2693f179272695ae17302e0060ed49d125eb473888cf3b38513f2c7ff3f5480/angular/angular/issues/49591 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2693f179272695ae17302e0060ed49d125eb473888cf3b38513f2c7ff3f5480/angular/angular/issues/49591 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No Description Zone.js tries to be clever and creates a single handler for all listeners to the same event on th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DavidANeil |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width