Skip to content

Fail fast on three silent outbox misconfigurations#309

Merged
Vulthil merged 1 commit into
mainfrom
fix/outbox-configuration-guards
Jul 9, 2026
Merged

Fail fast on three silent outbox misconfigurations#309
Vulthil merged 1 commit into
mainfrom
fix/outbox-configuration-guards

Conversation

@Vulthil

@Vulthil Vulthil commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • A second outbox-enabled DbContext now throws at startup instead of silently orphaning the first context's messages (relay/retention only ever resolve one IOutboxStore).
  • RelationalOutboxStore (Npgsql/MySql) now throws if the DbContext can't open a transaction, instead of silently relaying without one — previously FOR UPDATE SKIP LOCKED locks would release immediately, letting concurrent relay instances double-dispatch.
  • Publishing inside an ambient System.Transactions.TransactionScope with no EF Core transaction now throws NotSupportedException instead of silently publishing directly while the scope is uncommitted (a ghost message on rollback). Documented as unsupported; full support is deferred.

Verification

  • New/updated tests in Vulthil.SharedKernel.Outbox.Tests, a new Vulthil.SharedKernel.Infrastructure.Relational.Tests project, and Vulthil.Messaging.Outbox.Tests.
  • Confirmed each failure mode reproduces on unfixed main and is fixed here.
  • Full solution build (net9.0/net10.0) and all outbox-related test suites pass.
  • WebApi sample and TestHost's single-registration path confirmed unaffected.

Backport to v1.0: no — behavior guards (silence becomes throwing) are minor-appropriate; ships in 1.1.0.

@Vulthil
Vulthil merged commit 208a2f0 into main Jul 9, 2026
6 checks passed
@Vulthil
Vulthil deleted the fix/outbox-configuration-guards branch July 9, 2026 18:34
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