René's URL Explorer Experiment


Title: 9.1.0: with zone.js, Promise continuations run on the background thread that resolved the promise (main thread in 9.0.3) · Issue #528 · NativeScript/ios · GitHub

Open Graph Title: 9.1.0: with zone.js, Promise continuations run on the background thread that resolved the promise (main thread in 9.0.3) · Issue #528 · NativeScript/ios

X Title: 9.1.0: with zone.js, Promise continuations run on the background thread that resolved the promise (main thread in 9.0.3) · Issue #528 · NativeScript/ios

Description: Summary In @nativescript/ios 9.1.0, when zone.js is loaded (as in every NativeScript Angular app), a promise created on the main thread and resolved from a background GCD queue runs its .then() callbacks on that background thread. In 9.0...

Open Graph Description: Summary In @nativescript/ios 9.1.0, when zone.js is loaded (as in every NativeScript Angular app), a promise created on the main thread and resolved from a background GCD queue runs its .then() cal...

X Description: Summary In @nativescript/ios 9.1.0, when zone.js is loaded (as in every NativeScript Angular app), a promise created on the main thread and resolved from a background GCD queue runs its .then() cal...

Opengraph URL: https://github.com/NativeScript/ios/issues/528

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"9.1.0: with zone.js, Promise continuations run on the background thread that resolved the promise (main thread in 9.0.3)","articleBody":"### Summary\n\nIn `@nativescript/ios` 9.1.0, when zone.js is loaded (as in every NativeScript Angular app), a promise created on the main thread and resolved from a background GCD queue runs its `.then()` callbacks on that background thread. In 9.0.3 they ran on the main thread. The runtime's own (non-zone) `Promise` is still marshalled correctly in 9.1.0, so only zone.js promises are affected.\n\nIn a real app this means UIKit calls made after a native completion handler run off the main thread. For example, `@nativescript/imagepicker` calls `present()` after `PHPhotoLibrary.requestAuthorization`'s handler resolves a promise.\n\n### Repro\n\nBlank app (`ns create repro --ts`), `zone.js@0.16.3`, `@nativescript/core` 9.1.3. Replace `app/app.ts` with:\n\n```ts\nimport 'zone.js'\nimport { Application } from '@nativescript/core'\n\nfunction check(label: string, P: PromiseConstructor) {\n  const p = new P\u003cvoid>((resolve) => {\n    dispatch_async(dispatch_get_global_queue(0, 0), () => resolve())\n  })\n  p.then(() => console.log(`[repro] ${label}: then() runs on main thread = ${NSThread.isMainThread}`))\n}\n\nsetTimeout(() => {\n  check('zone.js Promise (global)', Promise)\n  check('runtime Promise (__zone_symbol__Promise)', (globalThis as any).__zone_symbol__Promise)\n}, 2000)\n\nApplication.run({ moduleName: 'app-root' })\n```\n\nOutput, iOS 26.3 simulator:\n\n| `@nativescript/ios` | zone.js `Promise` | runtime `Promise` |\n|---|---|---|\n| 9.0.3 | `then() runs on main thread = true` | `true` |\n| 9.1.0 | `then() runs on main thread = false` | `true` |\n\nWithout zone.js, 9.1.0 behaves correctly: `.then()` and an `await` continuation both run on the main thread.\n\n### Impact in our app (9.1.0)\n\n- **iOS 26.3 simulator:** opening the photo picker after the Photos permission check aborts the app (`EXC_BREAKPOINT`). The faulting thread is a background thread running `-[UIViewController presentViewController:animated:completion:]` ← `ffi_call` ← `tns::Interop::CallFunctionInternal`, while the main thread waits in `v8::Locker::Locker`.\n- **iPhone 11, iOS 27.0.1:** no crash. UIKit logs \"Modifying properties of a view's layer off the main thread is not allowed\", then `*** Assertion failure in … UIApplication.m:3444`, and the promise rejects with `NSInternalInconsistencyException: Call must be made on main thread`. The half-presented picker stays as `presentedViewController`, so every later `presentViewController` fails (\"… whose view is not in the window hierarchy\") until the app restarts.\n- **HealthKit:** `HKHealthStore requestAuthorizationToShareTypes:readTypes:completion:` (via `nativescript-health-data`) shows the same thing: \"Modifications to the layout engine must not be performed from a background thread\".\n- **Production build on 9.0.3** (same `@nativescript/imagepicker` 4.1.0 and `@nativescript-community/perms` 2.3.6), same device, same steps: works, with no off-main-thread messages.\n\n### Environment\n\n`@nativescript/ios` 9.1.0 vs 9.0.3, `@nativescript/core` 9.1.3, zone.js 0.16.3 (in the app: Angular 22.2, `@nativescript/angular` 22.0.2). NativeScript CLI 9.0.7, Xcode 26.3.\n\n### Possibly related\n\n#396 (\"only marshal promise resolution when created on the runtime loop\", merged 2026-07-08, fixes #330) is the only `PromiseProxy` change we found between 9.0.3 and 9.1.0. zone.js keeps the original `Promise` and schedules its microtasks through it, so this change may affect zone's microtask drain. We haven't confirmed that #396 is the cause.\n\n### Workaround\n\nPin `@nativescript/ios` to 9.0.3 and keep `@nativescript/core` 9.1.3. On that combination core installs `atob`/`btoa` as getter-only globals, so app code that assigns them needs a guard.\n","author":{"url":"https://github.com/VepretskiyD","@type":"Person","name":"VepretskiyD"},"datePublished":"2026-10-25T17:04:38Z","url":"https://github.com/NativeScript/ios/issues/528"}

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:75cab135-32e6-6e0d-4d7f-42c41dad1303
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCE1E:296654:18C2914:21045C1:6B014C3D
html-safe-noncea10c9a2d3b7520c7c733ad11bc4171c4dd04ebe26ebdc4392aeb79fdc8202a1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTFFOjI5NjY1NDoxOEMyOTE0OjIxMDQ1QzE6NkIwMTRDM0QiLCJ2aXNpdG9yX2lkIjoiNzE0MjA5MTE3MTE2OTM4OTYyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac62c2ca21c1fdd424d85a0f4c72079fbdf8c04d945da9db2ad68f6e05301a3411
hovercard-subject-tagissue:6026999391
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/NativeScript/ios/528/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9e6696ee3fa870279abc383aef0d874501161336d67b9ed4580575f3c1873413/NativeScript/ios/issues/528
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9e6696ee3fa870279abc383aef0d874501161336d67b9ed4580575f3c1873413/NativeScript/ios/issues/528
og:image:altSummary In @nativescript/ios 9.1.0, when zone.js is loaded (as in every NativeScript Angular app), a promise created on the main thread and resolved from a background GCD queue runs its .then() cal...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameVepretskiyD
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/ios git https://github.com/NativeScript/ios.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id172934359
octolytics-dimension-repository_nwoNativeScript/ios
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172934359
octolytics-dimension-repository_network_root_nwoNativeScript/ios
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/NativeScript/ios/issues/528#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fios%2Fissues%2F528
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%2FNativeScript%2Fios%2Fissues%2F528
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=NativeScript%2Fios
Reloadhttps://github.com/NativeScript/ios/issues/528
Reloadhttps://github.com/NativeScript/ios/issues/528
Reloadhttps://github.com/NativeScript/ios/issues/528
NativeScripthttps://github.com/NativeScript
ioshttps://github.com/NativeScript/ios
Codehttps://github.com/NativeScript/ios
Issues56 (56)https://github.com/NativeScript/ios/issues
Pull requests42 (42)https://github.com/NativeScript/ios/pulls
Actionshttps://github.com/NativeScript/ios/actions
Projectshttps://github.com/NativeScript/ios/projects
Security and qualityhttps://github.com/NativeScript/ios/security
Insightshttps://github.com/NativeScript/ios/insights
https://github.com/NativeScript/ios
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/528
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/528
9.1.0: with zone.js, Promise continuations run on the background thread that resolved the promise (main thread in 9.0.3)https://github.com/NativeScript/ios/issues/528#top
https://github.com/VepretskiyD
VepretskiyDhttps://github.com/VepretskiyD
on Oct 25, 2026https://github.com/NativeScript/ios/issues/528#issue-6026999391
#396https://github.com/NativeScript/ios/pull/396
#330https://github.com/NativeScript/ios/issues/330
#396https://github.com/NativeScript/ios/pull/396
https://github.com/VepretskiyD
VepretskiyDhttps://github.com/VepretskiyD
on Oct 26, 2026https://github.com/NativeScript/ios/issues/528#issuecomment-6411800962
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/ios/issues/528
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/528
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.