Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Fix gateway timeout when poll has 55 options (#1238)
Luke Vella02f7c3ac0605
diff --git a/package.json b/package.jsonindex 5863309cc..1c931e05f 100644--- a/package.json+++ b/package.json@@ -33,7 +33,7 @@"packages/*"],"dependencies": {- "@prisma/client": "^5.15.0",+ "@prisma/client": "^5.17.0","@sentry/nextjs": "^8.10.0","framer-motion": "^10.16.4","next": "^14.2.4",diff --git a/packages/backend/trpc/routers/polls/participants.ts b/packages/backend/trpc/routers/polls/participants.tsindex fc3a8e109..8b5dae388 100644--- a/packages/backend/trpc/routers/polls/participants.ts+++ b/packages/backend/trpc/routers/polls/participants.ts@@ -91,22 +91,26 @@ export const participants = router({throw new TRPCError({ code: "BAD_REQUEST", message: "Poll not found" });}- const participant = await prisma.participant.create({- data: {- pollId: pollId,- name: name,- email,- userId: user.id,- votes: {- createMany: {- data: votes.map(({ optionId, type }) => ({- optionId,- type,- pollId: pollId,- })),- },+ const participant = await prisma.$transaction(async (prisma) => {+ const participant = await prisma.participant.create({+ data: {+ pollId: pollId,+ name: name,+ email,+ userId: user.id,},- },+ });++ await prisma.vote.createMany({+ data: votes.map(({ optionId, type }) => ({+ optionId,+ type,+ pollId,+ participantId: participant.id,+ })),+ });++ return participant;});const emailsToSend: Promise<void>[] = [];diff --git a/packages/database/package.json b/packages/database/package.jsonindex 011be163e..15bd023b3 100644--- a/packages/database/package.json+++ b/packages/database/package.json@@ -14,7 +14,7 @@"@faker-js/faker": "^7.6.0","@rallly/tsconfig": "*","@types/node": "^18.15.10",- "prisma": "^5.15.0",+ "prisma": "^5.17.0","tsx": "^4.6.2"}}diff --git a/yarn.lock b/yarn.lockindex df7844526..5ab018ce6 100644--- a/yarn.lock+++ b/yarn.lock@@ -2950,46 +2950,46 @@resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz"integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==-"@prisma/client@^5.15.0":- version "5.15.0"- resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.15.0.tgz#a9443ace9b8a8d57aff70647168e95f2f55c5dc9"- integrity sha512-wPTeTjbd2Q0abOeffN7zCDCbkp9C9cF+e9HPiI64lmpehyq2TepgXE+sY7FXr7Rhbb21prLMnhXX27/E11V09w==+"@prisma/client@^5.17.0":+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.17.0.tgz#9079947bd749689c2dabfb9ecc70a24ebefb1f43"+ integrity sha512-N2tnyKayT0Zf7mHjwEyE8iG7FwTmXDHFZ1GnNhQp0pJUObsuel4ZZ1XwfuAYkq5mRIiC/Kot0kt0tGCfLJ70Jw==-"@prisma/[email protected]":- version "5.15.0"- resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.15.0.tgz#a4c1d8dbca9cf29aab1c82a56a65224ed3e05f13"- integrity sha512-QpEAOjieLPc/4sMny/WrWqtpIAmBYsgqwWlWwIctqZO0AbhQ9QcT6x2Ut3ojbDo/pFRCCA1Z1+xm2MUy7fAkZA==+"@prisma/[email protected]":+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.17.0.tgz#a765105848993984535b6066f8ebc6e6ead26533"+ integrity sha512-l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GTxm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg==-"@prisma/engines-version@5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022":- version "5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022"- resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022.tgz#4469a372b74088db05c0fc8cff65f229b804fa51"- integrity sha512-3BEgZ41Qb4oWHz9kZNofToRvNeS4LZYaT9pienR1gWkjhky6t6K1NyeWNBkqSj2llgraUNbgMOCQPY4f7Qp5wA==+"@prisma/engines-version@5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053":+ version "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"+ resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053.tgz#3c7cc1ef3ebc34cbd069e5873b9982f2aabf5acd"+ integrity sha512-tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg==-"@prisma/[email protected]":- version "5.15.0"- resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.15.0.tgz#bddf1973b5b0d2ebed473ed445b1a7c8dd23300b"- integrity sha512-hXL5Sn9hh/ZpRKWiyPA5GbvF3laqBHKt6Vo70hYqqOhh5e0ZXDzHcdmxNvOefEFeqxra2DMz2hNbFoPvqrVe1w==+"@prisma/[email protected]":+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.17.0.tgz#74dd1aabb22675892760b3cf69a448e3aef4616b"+ integrity sha512-+r+Nf+JP210Jur+/X8SIPLtz+uW9YA4QO5IXA+KcSOBe/shT47bCcRMTYCbOESw3FFYFTwe7vU6KTWHKPiwvtg==dependencies:- "@prisma/debug" "5.15.0"- "@prisma/engines-version" "5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022"- "@prisma/fetch-engine" "5.15.0"- "@prisma/get-platform" "5.15.0"+ "@prisma/debug" "5.17.0"+ "@prisma/engines-version" "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"+ "@prisma/fetch-engine" "5.17.0"+ "@prisma/get-platform" "5.17.0"-"@prisma/[email protected]":- version "5.15.0"- resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-5.15.0.tgz#f5bafd6aed3f58c41b5d0d6f832d652aa5d4cde7"- integrity sha512-z6AY5yyXxc20Klj7wwnfGP0iIUkVKzybqapT02zLYR/nf9ynaeN8bq73WRmi1TkLYn+DJ5Qy+JGu7hBf1pE78A==+"@prisma/[email protected]":+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-5.17.0.tgz#f718dc7426411d1ebeeee53e2d0d38652387f87c"+ integrity sha512-ESxiOaHuC488ilLPnrv/tM2KrPhQB5TRris/IeIV4ZvUuKeaicCl4Xj/JCQeG9IlxqOgf1cCg5h5vAzlewN91Q==dependencies:- "@prisma/debug" "5.15.0"- "@prisma/engines-version" "5.15.0-29.12e25d8d06f6ea5a0252864dd9a03b1bb51f3022"- "@prisma/get-platform" "5.15.0"+ "@prisma/debug" "5.17.0"+ "@prisma/engines-version" "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"+ "@prisma/get-platform" "5.17.0"-"@prisma/[email protected]":- version "5.15.0"- resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-5.15.0.tgz#d39fbe8458432f76afeb6c9199bffae73db4f5cc"- integrity sha512-1GULDkW4+/VQb73vihxCBSc4Chc2x88MA+O40tcZFjmBzG4/fF44PaXFxUqKSFltxU9L9GIMLhh0Gfkk/pUbtg==+"@prisma/[email protected]":+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-5.17.0.tgz#89fdcae2adddebbbf0e7bd0474a6c49d6023519b"+ integrity sha512-UlDgbRozCP1rfJ5Tlkf3Cnftb6srGrEQ4Nm3og+1Se2gWmCZ0hmPIi+tQikGDUVLlvOWx3Gyi9LzgRP+HTXV9w==dependencies:- "@prisma/debug" "5.15.0"+ "@prisma/debug" "5.17.0""@prisma/[email protected]":version "5.15.0"@@ -11843,12 +11843,12 @@ [email protected]:"@types/prismjs" "^1.26.0"clsx "^1.2.1"-prisma@^5.15.0:- version "5.15.0"- resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.15.0.tgz#887c295caa1b81b8849d94a2751cc0e0994f86d1"- integrity sha512-JA81ACQSCi3a7NUOgonOIkdx8PAVkO+HbUOxmd00Yb8DgIIEpr2V9+Qe/j6MLxIgWtE/OtVQ54rVjfYRbZsCfw==+prisma@^5.17.0:+ version "5.17.0"+ resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.17.0.tgz#267b43921ab94805b010537cffa5ccaf530fa066"+ integrity sha512-m4UWkN5lBE6yevqeOxEvmepnL5cNPEjzMw2IqDB59AcEV6w7D8vGljDLd1gPFH+W6gUxw9x7/RmN5dCS/WTPxA==dependencies:- "@prisma/engines" "5.15.0"+ "@prisma/engines" "5.17.0"version "1.29.0"