Title: zone.js timer patch throws when native timer returns null · Issue #70044 · angular/angular · GitHub
Open Graph Title: zone.js timer patch throws when native timer returns null · Issue #70044 · angular/angular
X Title: zone.js timer patch throws when native timer returns null · Issue #70044 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No. The same unguarded access exists in zone.js 0.14.10 and in the current main implementation. Description patchTimer() assumes that a non-numeric retu...
Open Graph Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No. The same unguarded access exists in zone.js 0.14.10 and in the current main implementation. Description patc...
X Description: Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No. The same unguarded access exists in zone.js 0.14.10 and in the current main implementation. Description patc...
Opengraph URL: https://github.com/angular/angular/issues/70044
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"zone.js timer patch throws when native timer returns null","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nzone.js\n\n### Is this a regression?\n\nNo. The same unguarded access exists in zone.js 0.14.10 and in the current `main` implementation.\n\n### Description\n\n`patchTimer()` assumes that a non-numeric return value from the native timer is an object. If an injected browser policy, extension, test harness, or automation wrapper blocks a timer and returns `null`, zone.js reads `handleOrId.refresh` and throws:\n\n```text\nTypeError: Cannot read properties of null (reading 'refresh')\n```\n\nThe current source assigns `data.handle = handleOrId` and then calls `isFunction(handleOrId.refresh)` without checking that `handleOrId` is non-null.\n\n### Minimal reproduction\n\n```html\n\u003c!doctype html>\n\u003cscript>\n const nativeSetTimeout = window.setTimeout;\n window.setTimeout = function (callback, delay, ...args) {\n if (delay >= 30000) return null;\n return nativeSetTimeout(callback, delay, ...args);\n };\n\u003c/script>\n\u003cscript src=\"https://unpkg.com/zone.js@0.14.10/bundles/zone.umd.js\">\u003c/script>\n\u003cscript>\n setTimeout(() => {}, 30000);\n\u003c/script>\n```\n\n### Expected behavior\n\nzone.js should not dereference a null timer handle. A nullish guard around refresh detection would preserve the existing numeric and Node.js handle behavior, for example by treating a nullish handle as non-refreshable.\n\n### Actual behavior\n\nThe call throws synchronously from `patchTimer.scheduleTask()` while reading `.refresh`.\n\n### Environment\n\n- zone.js: 0.14.10\n- Browser case observed with an injected timer blocker returning `null`\n- Also reproducible with the standalone wrapper above\n\n### Additional context\n\nWe observed both `setTimeout(30000)` and `setInterval(86400000)` variants. This is an interoperability boundary: browsers normally return numeric timer IDs, but wrappers that intentionally block long timers can return null. Application-side filtering can suppress duplicate telemetry, but the underlying null dereference remains in zone.js.\n","author":{"url":"https://github.com/ParryQiu","@type":"Person","name":"ParryQiu"},"datePublished":"2026-08-01T09:59:56Z","url":"https://github.com/angular/angular/issues/70044"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b994dadc-567a-f773-f1f1-6acbab11124f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D99C:2C3566:12E3481:18F1AA7:6B011874 |
| html-safe-nonce | 403ef3eac37cc86f5ffc44c00fd2fb6a5debd6d89b7f16d15f413c137354dbab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTlDOjJDMzU2NjoxMkUzNDgxOjE4RjFBQTc6NkIwMTE4NzQiLCJ2aXNpdG9yX2lkIjoiODI4MDg0OTAwMzIxMDQxNDE5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56c3d3a9e98ae0e8b75e24eda9432dcb699ca045dd0befebe6d19659d950cf34 |
| hovercard-subject-tag | issue:5036482319 |
| 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/70044/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f75ab9d9d0dfb3bbc5567aca04eaebcb5cef7f7635228adbeb79d76619e14217/angular/angular/issues/70044 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f75ab9d9d0dfb3bbc5567aca04eaebcb5cef7f7635228adbeb79d76619e14217/angular/angular/issues/70044 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? zone.js Is this a regression? No. The same unguarded access exists in zone.js 0.14.10 and in the current main implementation. Description patc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ParryQiu |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width