You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MongoDB TransientTransactionError / WriteConflict is not retried for Payload Local API writes #16766
Payload starts MongoDB transactions by default for Local API write operations, but when MongoDB throws a retryable transaction error such as TransientTransactionError / WriteConflict, Payload aborts the transaction and rethrows the error instead of retrying the whole transaction body.
MongoDB treats WriteConflict inside transactions as expected optimistic concurrency behavior. The recommended handling is to retry the full transaction when the error has the TransientTransactionError label. The MongoDB driver's higher-level session.withTransaction() API does this retry behavior automatically.
❌ In Payload, the current flow appears to be manual transaction handling:
Hi @dolanoadriano — great writeup. Are you actively working on a PR for this? If not, I'd like to take a shot at implementing the runWithTransactionRetry wrapper. Happy to coordinate if you're already mid-way through it.
Activity
cbratschi commentedon May 29, 2026
Might be related to #4350.
dolanoadriano commentedon Jun 3, 2026
@r1tsuu
Shankhadeep25 commentedon Jun 6, 2026
Hi @dolanoadriano — great writeup. Are you actively working on a PR for this? If not, I'd like to take a shot at implementing the
runWithTransactionRetrywrapper. Happy to coordinate if you're already mid-way through it.