Asjas/prisma-redis-middleware

prisma query stuck at prisma.$transaction

ayame30 opened this issue · 0 comments

Describe the bug
for case prisma.$transaction([queryA, queryB]) , if queryA was found in cache, queryB will stuck in transaction.

To Reproduce
Steps to reproduce the behavior:

async paginatedResult(skip: number) {
  const [totalCount, result] = await this.prisma.$transaction([
    this.prisma.article.count(),
    this.prisma.article.findMany({ skip })
  ]);
  return { totalCount, result };
}
  1. query with paginatedResult(0)
  2. response 200 successfully, and result cached
  3. query with paginatedResult(1)
  4. request freeze until timeout

Expected behavior
for case prisma.$transaction([queryA, queryB]) , return cached result if both queryA and queryB was found in cache, otherwise fetch from prisma.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: postman
  • Version: ^4.8.0