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
unfortunately, Mercurius also requires enterWith: true to be true. The issue occurs not if using fastify.inject - only with "real clients". I have absolutely no idea why, but that seems to fix it. I opened a PR to replace fastify.inject with supertest in the mercurius e2e test and to set useEnterWith: true. I also updated the documentation accordingly.
The text was updated successfully, but these errors were encountered:
psteinroe
changed the title
Execution context is lost with mercurius without enterWith: true
Execution context is also lost with mercurius without enterWith: true
Oct 5, 2021
That's really unfortunate :( That means there's really no 100% safe way to use cls with GQL, because AsyncLocalStorage.enterWith() can leak context between concurrent calls.
Thanks for the PR, I have merged it, and I will publish it with a new version in a couple of days.
I'll have to do some more tests to verify that no context is leaked in a request after it goes past the ClsMiddleware, but I fear the worst. (I have discovered that I can access the context of the previous request before enter is called in the middleware)
Hi,
unfortunately, Mercurius also requires
enterWith: true
to be true. The issue occurs not if usingfastify.inject
- only with "real clients". I have absolutely no idea why, but that seems to fix it. I opened a PR to replacefastify.inject
with supertest in the mercurius e2e test and to setuseEnterWith: true
. I also updated the documentation accordingly.The text was updated successfully, but these errors were encountered: