payloadcms / payloadcms/payload
promise.all-ing in a txn with vercel postgres fails
@AlessioGr is already working on this.
Since Feb 4, 2026.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
In summary, if you...
- use
@payloadcms/db-vercel-postgres - start a transaction with
payloadClient.db.beginTransaction() Promise.all()over some mutating payload queries such aspayloadClient.update()- Call
payloadClient.db.commitTransaction(transactionId)
No error will be thrown, but some of the queries in the transaction will not be reflected in the db.
I have created a minimal reproduction of this that can reliably show the issue. If you change the reproduction code to use @payloadcms/db-postgres the issue goes away.
The issue also occurs when calling update() with a where parameter. I think this is because it uses Promise.all under the hood. For this reason, I suspect this is related to #15403 and to #14247 where I opened a similar issue but made a mistake in my reproduction, and I didn't realize db-vercel-postgres was the root cause of the issue.
Link to the code that reproduces this issue
https://github.com/tau9-labs/payload-txn-repro-3/pull/1/changes
Reproduction Steps
- Pull the code at https://github.com/tau9-labs/payload-txn-repro-3/tree/minimal-repro
- Run
pnpm i - Run
pnpm dev - Visit
localhost:3000/repro - Click the
Run Reproductionbutton a few times until it says "BUG REPRODUCED"
Alternatively, you can run pnpm reproduce to show the behavior
Which area(s) are affected?
db: vercel-postgres
Environment Info
pnpm payload info
> payload-txn-repro-3@1.0.0 payload /Users/chandler/Documents/tau9/payload-txn-repro-3
> cross-env NODE_OPTIONS=--no-deprecation payload info
Binaries:
Node: 22.21.1
npm: 10.9.4
Yarn: N/A
pnpm: 10.20.0
Relevant Packages:
payload: 3.74.0
next: 15.4.11
@payloadcms/db-vercel-postgres: 3.74.0
@payloadcms/drizzle: 3.74.0
@payloadcms/graphql: 3.74.0
@payloadcms/next/utilities: 3.74.0
@payloadcms/richtext-lexical: 3.74.0
@payloadcms/translations: 3.74.0
@payloadcms/ui/shared: 3.74.0
react: 19.2.1
react-dom: 19.2.1
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:41 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6031
Available memory (MB): 36864
Available CPU cores: 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.