Skip to content

[codex] Reset scoped unit of work after rollback - #24

Merged
SadPossum merged 1 commit into
devfrom
codex/transactional-uow-rollback-reset
Aug 15, 2026
Merged

[codex] Reset scoped unit of work after rollback#24
SadPossum merged 1 commit into
devfrom
codex/transactional-uow-rollback-reset

Conversation

@SadPossum

@SadPossum SadPossum commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What changed

  • add the optional, provider-neutral IRollbackResettableUnitOfWork contract;
  • reset transactional command state after rollback for failed results and exceptions, even when rollback itself fails;
  • clear EF Core change tracking so abandoned mutations and domain events cannot leak into a later command in the same dependency-injection scope;
  • preserve the original operation exception while retaining rollback/reset failures as diagnostic data;
  • document the contract and add same-scope regression coverage.

Why

Rolling back a database transaction does not clear EF Core tracking. A failed handler could leave modified aggregates and queued domain events in a scoped DbContext, allowing an unrelated later command in that same scope to persist work that had already failed.

The capability is optional, so custom unit-of-work implementations remain source-compatible. EF-backed implementations opt in through the shared base class.

Consolidation

This branch is rebased on current dev, which already contains the framework solution synchronization and patched SSH.NET test-harness dependency. Redundant drafts #23 and #25 are closed; this is the only active Framework PR.

Validation

  • full warning-as-error solution build
  • focused rollback/reset regression tests
  • full non-Docker Framework test suite
  • solution synchronization and source-package checks
  • repository security and release checks
  • direct/transitive vulnerability audit
  • hosted validate, provider, owned-source, and Trivy jobs

@SadPossum
SadPossum force-pushed the codex/transactional-uow-rollback-reset branch from 67ce38a to 00b4dac Compare August 15, 2026 08:04
@SadPossum
SadPossum marked this pull request as ready for review August 15, 2026 08:11
@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@SadPossum
SadPossum merged commit efcd7a6 into dev Aug 15, 2026
4 checks passed
@SadPossum
SadPossum deleted the codex/transactional-uow-rollback-reset branch August 15, 2026 08:11
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.

1 participant