mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit updates the implementation of the `fetch` patch and additionally patches `Response` methods which return promises. These are `arrayBuffer`, `blob`, `formData`, `json` and `text`. This fixes the issue when zone becomes stable too early before all of the `fetch` tasks complete. Given the following code: ```ts appRef.isStable.subscribe(console.log); fetch(...).then(response => response.json()).then(console.log); ``` The `isStable` observer would log `false, true, false, true`. This was happening because `json()` was returning a native promise (and not a `ZoneAwarePromise`). But calling `then` on the native promise returns a `ZoneAwarePromise` which notifies Angular about the task being scheduled and forces to re-calculate the `isStable` state. Issue: #50327 PR Close #50653 |
||
|---|---|---|
| .. | ||
| Error.spec.ts | ||
| fetch.spec.ts | ||
| microtasks.spec.ts | ||
| promise-disable-wrap-uncaught-promise-rejection.spec.ts | ||
| Promise.spec.ts | ||
| queue-microtask.spec.ts | ||
| setInterval.spec.ts | ||
| setTimeout.spec.ts | ||
| task.spec.ts | ||
| toString.spec.ts | ||
| util.spec.ts | ||
| zone.spec.ts | ||