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
However, if the middleware runs again for a different concurrent request to a different route before the actual handler does the querying, it will overwrite Knex.__req__ with the new request. This can happen if the handler yields the event loop before it queries.
E.g. request comes for /foo and while it awaits something(), a request comes for /bar causing the middleware to overwrite __req__. Then /foo runs knex.select() and the query is annotated with the wrong request:
This effects both sequelize and knex as they use the same mechanism. The middleware sets the current request on the global
Knexobject:sqlcommenter/nodejs/sqlcommenter-nodejs/packages/sqlcommenter-knex/index.js
Lines 154 to 155 in 0e873a7
And then uses this request in the wrapped query function to get route information
sqlcommenter/nodejs/sqlcommenter-nodejs/packages/sqlcommenter-knex/index.js
Lines 70 to 72 in 0e873a7
However, if the middleware runs again for a different concurrent request to a different route before the actual handler does the querying, it will overwrite
Knex.__req__with the new request. This can happen if the handler yields the event loop before it queries.E.g. request comes for
/fooand while it awaitssomething(), a request comes for/barcausing the middleware to overwrite__req__. Then/foorunsknex.select()and the query is annotated with the wrong request: