Skip to content

bug: UI does not update after async/await operations with Zone.js enabled in v9 #31406

Description

@maxsteinwand

Prerequisites

Ionic Framework Version

v9.x

Current Behavior

Upgrading from @ionic/angular@8.8.19 to @ionic/angular@9.0.0 causes a UI refresh issue during async state updates.

My project is running Angular 22 with @ionic/angular@8.8.19, where async updates resolved and rendered normally. Updating to v9 and following the migration guide, Zone.js was kept (See Reproduction). Despite this setup, UI changes occurring after async calls fail to trigger change detection.

Expected Behavior

Async operations should remain within the NgZone context. When variables are updated after an await Zone.js should automatically detect the change and trigger UI re-rendering without requiring manual calls to ChangeDetectorRef.

Steps to Reproduce

  1. Go to Reproduction URL (with @ionic/angular@8.8.19 and @ionic/core@8.8.19 using @ionic/angular/standalone imports).
  2. Press Switch Data.
  3. Variable changes reflect immediately in the UI both before and after the awaited setTimeout (expected behavior).
  4. Upgrade packages to v9.0.0:
    npm install @ionic/angular@9.0.0 @ionic/core@9.0.0
  5. Ensure imports use @ionic/angular instead of @ionic/angular/standalone (according to v9 upgrade guide).
  6. Press Switch Data again.
  7. Variable changes are now only reflected before the awaited setTimeout. Any change occurring afterward does not update the UI until Switch Data is triggered again or cdr.markForCheck() is manually called via Check UI.

Code Reproduction URL

https://stackblitz.com/edit/bqjzhqnj?file=package.json,src%2Fapp%2Fexample.component.html,src%2Fapp%2Fexample.component.ts,src%2Fapp%2Fapp.component.html

Ionic Info

Unrelated Project where i found the Bug
Ionic:
Ionic CLI : 7.2.1
Ionic Framework : @ionic/angular 9.0.0
@angular-devkit/build-angular : not installed
@angular-devkit/schematics : 20.0.1
@angular/cli : 22.1.5
@ionic/angular-toolkit : 13.0.0

Capacitor:
Capacitor CLI : 8.4.0
@capacitor/android : 8.4.0
@capacitor/core : 8.4.0
@capacitor/ios : not installed

Utility:
cordova-res : not installed globally
native-run : not installed globally

System:
NodeJS : v24.19.0 (C:\nvm4w\nodejs\node.exe)
npm : 11.17.0
OS : Windows 10

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: buga confirmed bug report

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions