This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 407
Wrong current zone observed inside Bluebird's then() #921
Comments
@vkopyl , thank you for reporting the issue, I will check it. |
I am also observing the same issue. Code: require('zone.js');
const P1 = require('bluebird');
Zone.current.fork({name: 'Zone Fork 1'}).run(() => {
console.log(`============> Zone Name Outside of Promise 1: ** ${Zone.current.name} **`);
P1.resolve().then((_record) => {
console.log(`===============================================================`);
console.log(`============> Zone Name Inside of Promise 1: ** ${Zone.current.name} **`);
});
});
Zone.current.fork({name: 'Zone Fork 2'}).run(() => {
console.log(`============> Zone Name Outside of Promise 2: ** ${Zone.current.name} **`);
P1.resolve().then((_record) => {
console.log(`============> Zone Name Inside of Promise 2: ** ${Zone.current.name} **`);
});
});
Zone.current.fork({name: 'Zone Fork 3'}).run(() => {
console.log(`============> Zone Name Outside of Promise 3: ** ${Zone.current.name} **`);
P1.resolve().then((_record) => {
console.log(`============> Zone Name Inside of Promise 3: ** ${Zone.current.name} **`);
});
}); Output: ============> Zone Name Outside of Promise 1: ** Zone Fork 1 **
============> Zone Name Outside of Promise 2: ** Zone Fork 2 **
============> Zone Name Outside of Promise 3: ** Zone Fork 3 **
===============================================================
============> Zone Name Inside of Promise 1: ** Zone Fork 1 **
============> Zone Name Inside of Promise 2: ** Zone Fork 1 **
============> Zone Name Inside of Promise 3: ** Zone Fork 1 ** I am still looking how to fix or just to have a workaround. |
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 4, 2018
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 4, 2018
@vkopyl , @furqanaziz , I have fixed this one, please wait for the next release. |
mhevery
pushed a commit
that referenced
this issue
Mar 14, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
Observing the issue when using bluebird module. Fork a zone 'A' with a bluebird promise in run. Check Zone.current.name in then function. In should be 'A'. Fork a new zone, 'B', check Zone.current in then. Expected 'B', but it still reports 'A'.
(running in Node v6.11.3)
Please check: https://runkit.com/vkopyl/test-bluebird-with-zone-js
The text was updated successfully, but these errors were encountered: