René's URL Explorer Experiment


Title: zone.js drains microtasks too early in synchronous event call · Issue #44446 · angular/angular · GitHub

Open Graph Title: zone.js drains microtasks too early in synchronous event call · Issue #44446 · angular/angular

X Title: zone.js drains microtasks too early in synchronous event call · Issue #44446 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? No Description Please see the reproduction. It seems zone.js assumes EventTarget's event call is always a standalone task, which may not be ...

Open Graph Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? No Description Please see the reproduction. It seems zone.js assumes EventTarget's event call is alw...

X Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? No Description Please see the reproduction. It seems zone.js assumes EventTarget's event cal...

Opengraph URL: https://github.com/angular/angular/issues/44446

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"zone.js drains microtasks too early in synchronous event call","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nDon't known / other\n\n### Is this a regression?\n\nNo\n\n### Description\n\nPlease see the reproduction. It seems zone.js assumes EventTarget's event call is always a standalone task, which may not be true.\r\n\r\n```js\r\nconst invoke = (fn) => {\r\n  document.body.addEventListener('click', fn);\r\n  document.body.click();\r\n  document.body.removeEventListener('click', fn);\r\n};\r\n\r\ninvoke(() => {\r\n  Promise.resolve().then(() => console.log(2));\r\n});\r\nconsole.log(1);\r\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/typescript-88btqj?file=index.ts\n\n### Please provide the exception or error you saw\n\n```true\nNative Chrome/Safari/Firefox outputs `1 2`, while with zone.js outputs `2 1`.\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n_No response_\n\n### Anything else?\n\nI noticed this during debugging https://github.com/angular/angular/issues/41506#issuecomment-991765487 , maybe related.","author":{"url":"https://github.com/xiaody","@type":"Person","name":"xiaody"},"datePublished":"2021-12-11T20:27:19Z","url":"https://github.com/angular/angular/issues/44446"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:afa30691-93e1-7ce1-d5be-bd3f3706828c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBEC2:26ECEB:1D1245E:2500F67:6B014825
html-safe-nonce2bf4ec26350e110fa4afca6195a17eb962d77f59784e3cfee725a5eca543bab5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUMyOjI2RUNFQjoxRDEyNDVFOjI1MDBGNjc6NkIwMTQ4MjUiLCJ2aXNpdG9yX2lkIjoiMTc5MTg2NDI3ODk5MTU4NzM2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2af7b478281f0e1ebd0d557e0202b17ce09220b7293dfce43fb22a67c4fdd0ef
hovercard-subject-tagissue:1077640996
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/44446/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d2bedd37b4dbd9342dd468a85474f2ac640371e906e5baab4a589e0ba2e0b4ca/angular/angular/issues/44446
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d2bedd37b4dbd9342dd468a85474f2ac640371e906e5baab4a589e0ba2e0b4ca/angular/angular/issues/44446
og:image:altWhich @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? No Description Please see the reproduction. It seems zone.js assumes EventTarget's event call is alw...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamexiaody
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/44446#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F44446
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F44446
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/44446
Reloadhttps://github.com/angular/angular/issues/44446
Reloadhttps://github.com/angular/angular/issues/44446
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/44446
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/44446
#68134https://github.com/angular/angular/pull/68134
zone.js drains microtasks too early in synchronous event callhttps://github.com/angular/angular/issues/44446#top
#68134https://github.com/angular/angular/pull/68134
https://github.com/JiaLiPassion
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/xiaody
xiaodyhttps://github.com/xiaody
on Dec 11, 2021https://github.com/angular/angular/issues/44446#issue-1077640996
https://stackblitz.com/edit/typescript-88btqj?file=index.tshttps://stackblitz.com/edit/typescript-88btqj?file=index.ts
#41506 (comment)https://github.com/angular/angular/issues/41506#issuecomment-991765487
Nexthttps://github.com/angular/angular/issues/44446?timeline_page=1
JoostKhttps://github.com/JoostK
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
on Dec 11, 2021https://github.com/angular/angular/issues/44446#event-5752043467
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Dec 11, 2021https://github.com/angular/angular/issues/44446#event-5752043480
JiaLiPassionhttps://github.com/JiaLiPassion
on Feb 20, 2022https://github.com/angular/angular/issues/44446#event-6107264654
https://github.com/JiaLiPassion
JiaLiPassionhttps://github.com/JiaLiPassion
on Feb 20, 2022https://github.com/angular/angular/issues/44446#issuecomment-1046242550
@xiaodyhttps://github.com/xiaody
https://github.com/xiaody
xiaodyhttps://github.com/xiaody
on Feb 23, 2022https://github.com/angular/angular/issues/44446#issuecomment-1048477632
uses such patternhttps://github.com/facebook/react/blob/4e6eec69be632c0c0177c5b1c8a70397d92ee181/packages/shared/invokeGuardedCallbackImpl.js#L190-L195
#41506https://github.com/angular/angular/issues/41506
JiaLiPassionhttps://github.com/JiaLiPassion
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
on Mar 5, 2022https://github.com/angular/angular/issues/44446#event-6189300421
ksz-kszhttps://github.com/ksz-ksz
on Jun 8, 2022https://github.com/angular/angular/issues/44446#event-6771675698
mitigate zonejs issuehttps://github.com/ksz-ksz/rxjs-insights/commit/b8b32109d2ecefdb96b34ea3c1519d52535b8401
b8b3210https://github.com/ksz-ksz/rxjs-insights/commit/b8b32109d2ecefdb96b34ea3c1519d52535b8401
alxhubhttps://github.com/alxhub
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
on Nov 16, 2022https://github.com/angular/angular/issues/44446#event-7825713377
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Nov 16, 2022https://github.com/angular/angular/issues/44446#event-7825713616
JiaLiPassionhttps://github.com/JiaLiPassion
on Apr 1, 2024https://github.com/angular/angular/issues/44446#event-12312004124
fix(zone.js): always run microtasks in Promise.then to avoid drain mi…https://github.com/JiaLiPassion/angular/commit/a37c469b702e2f7d4b3729b24bb67d545c312996
https://docs.github.com/articles/closing-issues-via-commit-messages
a37c469https://github.com/JiaLiPassion/angular/commit/a37c469b702e2f7d4b3729b24bb67d545c312996
arturovthttps://github.com/arturovt
on Apr 10, 2026https://github.com/angular/angular/issues/44446#event-24395758276
fix(zone.js): allow draining microtasks in `Promise.then` (through flag)https://github.com/arturovt/angular/commit/948ccc71f4e4111c7ddaf7cbdb6bc70bd47bc5b8
https://docs.github.com/articles/closing-issues-via-commit-messages
948ccc7https://github.com/arturovt/angular/commit/948ccc71f4e4111c7ddaf7cbdb6bc70bd47bc5b8
fix(zone.js): allow draining microtasks in `Promise.then` (through flag)https://github.com/arturovt/angular/commit/acf8233f71ddd3b75c65d5c2ffa775f45c046fd4
https://docs.github.com/articles/closing-issues-via-commit-messages
acf8233https://github.com/arturovt/angular/commit/acf8233f71ddd3b75c65d5c2ffa775f45c046fd4
fix(zone.js): allow draining microtasks in `Promise.then` (through flag)https://github.com/arturovt/angular/commit/45a4650771ff17406bc1ef930f9c7eb3099a0ce4
https://docs.github.com/articles/closing-issues-via-commit-messages
45a4650https://github.com/arturovt/angular/commit/45a4650771ff17406bc1ef930f9c7eb3099a0ce4
kirjshttps://github.com/kirjs
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#68134https://github.com/angular/angular/pull/68134
on Apr 15, 2026https://github.com/angular/angular/issues/44446#event-24532566880
kirjshttps://github.com/kirjs
on Apr 15, 2026https://github.com/angular/angular/issues/44446#event-24532568724
fix(zone.js): allow draining microtasks in `Promise.then` (through flag)https://github.com/angular/angular/commit/eddca4280b3026cbdff3153442df30b5c5870e3f
https://docs.github.com/articles/closing-issues-via-commit-messages
eddca42https://github.com/angular/angular/commit/eddca4280b3026cbdff3153442df30b5c5870e3f
angular-robothttps://github.com/angular-robot
on Apr 15, 2026https://github.com/angular/angular/issues/44446#event-24532578172
fix(zone.js): allow draining microtasks in `Promise.then` (through flag)https://github.com/angular-robot/angular/commit/fc6a7eea682a76f03e85c4786aed3b02bdb06968
https://docs.github.com/articles/closing-issues-via-commit-messages
fc6a7eehttps://github.com/angular-robot/angular/commit/fc6a7eea682a76f03e85c4786aed3b02bdb06968
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on May 16, 2026https://github.com/angular/angular/issues/44446#issuecomment-4464744952
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on May 16, 2026https://github.com/angular/angular/issues/44446#event-25598172101
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/44446
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/44446
JiaLiPassionhttps://github.com/JiaLiPassion
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.