Description
Hello,
We are using async hook in our node application. We want to track each and every request's context as an when it comes. we are creating a chain of request context in one map based on the trigger ID and async ID.
Find the below code for creating a chain.
init(asyncId, type, triggerAsyncId, _resource) {
if (this.tracked.has(triggerAsyncId)) {
this.tracked.set(asyncId, this.tracked.get(triggerAsyncId));
}
}
Here in the above snippet "this.tracked" is map and we are creating a chain of context inside this map and also using this map to get the context based on the asyncID.
It works fine until we move one page to another page very quickly.
When we move from one page to another page very quickly and try to get the context object from our map using the async ID it gives the older context, and the chain breaks.
We believe that out page is called before async hook init finishes its job...
Let me know if you need any more information on this.
Thanks in advance
Ronak Pandya