You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 080bbd2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(http): create macrotask during request handling instead of load start (#50406)
This commit schedules the macrotask creation to happen before the XHR `loadStart` event. This is needed as in some cases, Zone.js becomes stable too early.
With this commit, we also update the internal `createBackgroundMacroTask` method to use Zone.js `scheduleMacroTask` as otherwise the `setTimeout` would cause `fakeAsync` tests to fail due to pending timers.
Closes#50405
PR Close#50406
Copy file name to clipboardExpand all lines: packages/common/http/src/xhr.ts
+28-19Lines changed: 28 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,10 @@ export class HttpXhrBackend implements HttpBackend {
60
60
`Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
61
61
}
62
62
63
+
// Schedule a macrotask. This will cause NgZone.isStable to be set to false,
64
+
// Which delays server rendering until the request is completed.
0 commit comments