Skip to content

fix(connection): restore delete state across transaction retries - #16435

Merged
vkarpov15 merged 1 commit into
Automattic:masterfrom
snowyukitty:fix/transaction-delete-state-retry
Aug 5, 2026
Merged

vkarpov15 merged 1 commit into
Automattic:masterfrom
snowyukitty:fix/transaction-delete-state-retry

Conversation

@snowyukitty

Copy link
Copy Markdown
Contributor

Summary

Restore a document's $isDeleted state when Connection#transaction() aborts an attempt. Without this reset, a retried Document#deleteOne() resolves as a no-op and the document remains in MongoDB.

Examples

Added a regression test that retries a transaction after a transient error and verifies that both attempts begin with $isDeleted() === false and the final commit deletes the document.

Fixes #16433

@vkarpov15 vkarpov15 added this to the 9.9.2 milestone Aug 5, 2026
@vkarpov15
vkarpov15 merged commit 7e09104 into Automattic:master Aug 5, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection#transaction() does not restore $isDeleted before retrying Document#deleteOne()

2 participants