Middleware + $transactions do not play well together #7584
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/regression
A reported bug in functionality that used to work before.
team/client
Issue for team Client.
topic: middleware
topic: transaction
Milestone
Bug description
If I use a middleware to Client, then call a
prisma.$transaction
, then the middleware blocks query execution.How to reproduce
Assume this schema:
I have a middlware that modifies Client responses to also include some extra parameters with it:
However:
response
seems to be an async function. If I logresponse.toString()
, it looks like callingnext
returns the actualnext
function. If I call this returned value again, like so:then everything works as expected. I see the correct log and the query gets executed.
Expected behavior
No response
Prisma information
model User {
id Int @id
name String
}
Environment & setup
Prisma Version
This seems to only be happening on
dev
. Prisma 2.24.1 behaves as expected.I'm on:
Internal Slack https://prisma-company.slack.com/archives/C016KUHB1R6/p1623327462109600
The text was updated successfully, but these errors were encountered: