Use retryTransaction instead of raw $transaction
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled

Fixes lint error: .$transaction is disallowed, use retryTransaction().
This commit is contained in:
Bilal Godil 2026-03-19 13:32:07 -07:00
parent 2971b655ff
commit e74b2cd89e

View File

@ -1,7 +1,7 @@
import { recordExternalDbSyncDeletion } from "@/lib/external-db-sync";
import { validateRedirectUrl } from "@/lib/redirect-urls";
import { getSoleTenancyFromProjectBranch, getTenancy, Tenancy } from "@/lib/tenancies";
import { globalPrismaClient } from "@/prisma-client";
import { globalPrismaClient, retryTransaction } from "@/prisma-client";
import { Prisma, VerificationCodeType } from "@/generated/prisma/client";
import { KnownErrors } from "@stackframe/stack-shared";
import { ProjectsCrud } from "@stackframe/stack-shared/dist/interface/crud/projects";
@ -277,7 +277,7 @@ export function createVerificationCodeHandler<
const { project, branchId } = parseProjectBranchCombo(revokeOptions);
const tenancy = await getSoleTenancyFromProjectBranch(project.id, branchId);
await globalPrismaClient.$transaction(async (tx) => {
await retryTransaction(globalPrismaClient, async (tx) => {
// Record deletion for external DB sync if this is a TEAM_INVITATION code
if (options.type === 'TEAM_INVITATION') {
await recordExternalDbSyncDeletion(tx, {