Skip to content

GH-5295 Explicit IDbContextOutbox<T> binds the ancillary store - #5303

Merged
jeremydmiller merged 1 commit into
mainfrom
stoat/critterwatch-1-2/wolverine-5295-outbox-ancillary
Oct 31, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
stoat/critterwatch-1-2/wolverine-5295-outbox-ancillary

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Fixes #5295

DbContextOutbox<T> (and the non-generic DbContextOutbox, in Enroll) now bind the ancillary store the DbContext is enrolled in, so no OverrideStorage workaround is needed.

The reproduction showed the cause is wider than the delete: EfCoreEnvelopeTransaction finds its message database from the context's storage, which was still the main store at construction. The envelope was written through the main store's schema/commands and only coincidentally landed in the right place when both stores shared a schema name; the eager-flush delete then also went to the main store. The test fails before the fix on the first assertion (row not in the ancillary store) and passes after. Covers both the generic and non-generic outbox. Full EfCoreTests: 487/487.

🤖 Generated with Claude Code

The DbContextOutbox constructors never bound the ancillary store, so the envelope was
persisted through, and an eager flush deleted it from, the main store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 106c808 into main Oct 31, 2026
49 checks passed
This was referenced Nov 1, 2026
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.

Follow-up to #4417: explicit IDbContextOutbox<T> still acknowledges the main store on eager delivery

1 participant