-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zone.js unexpected promise callbacks execution order #48767
Comments
Why are you expecting an execution order when there is none written in your code ? |
I would expect first registered callback to be executed first. |
By the way, this is not directly caused by When using target ES2017+ tsc doesn't transform the |
As @JeanMeche says, this is not behavior that |
Added a tsconfig to the example to play with that and indeed, setting the target to ES2016 removes this behaviour.
I don't follow you here, in case anything was happening under the hood with stackblitz, I have created a simpler reproduction: https://datadoghq.dev/browser-sdk-test-playground/callback-order/with-zone.html I still have this behaviour without any tool downleveling
Any insight on why it seems specific to fetch? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
The execution order of promise callbacks is not consistent with native behaviour when:
fetch
apiExpected output (same as native):
Actual output:
By using
Promise.resolve
instead offetch
, it behaves as expected.Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/zone-playground-vgkwya?file=index.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Additional explorations: https://stackblitz.com/edit/zone-playground-ddx3mw?file=index.ts
The text was updated successfully, but these errors were encountered: