Calling findUnique
concurrently with different key order causes one of them to return null
#16267
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: batching
topic: findUnique()
Milestone
Bug description
There is an issue with Prisma which causes concurrent usages of
findUnique()
to return null values if the calls specify the uniqueWhereInput keys in different ordersfindUnique
orfindUniqueOrThrow
findUnique
calls are made concurrently and Prisma runs them in a batched query.Example:
Workraround
How to reproduce
I created a standalone repo at https://github.com/BlooJeans/prisma-issue-concurrent-findUnique-keyorder-matters
Thanks to @stayradiated for providing an easy to use barebones repo to base off of
Expected behavior
Two concurrent calls to
findUnique()
shouldn't interfere with eachother, specifically when they're called with two different orders.Prisma information
Which produces:
Same query but with
DEBUG="*"
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: