fix: BugHunt remediation PR C-1 - persistence integrity + event delivery (M1, M2, M6, M7, M8, M10, M29, M32) - #179
Merged
Conversation
…capture, repository audit stamping - M1: a transient failure during CommitTransaction no longer re-enters the execution-strategy delegate; it surfaces as the new TransactionCommitAmbiguousException (original as inner) so a possibly durable commit is never blindly re-run. Multi-source witness verification deliberately deferred and documented. - M6: after the bounded save-pass loop, any cached context still reporting ChangeTracker.HasChanges() fails the save loudly instead of dropping the changes silently. - M7: domain-event capture now skips exactly the entries SaveWithIdentityInsertAsync temporarily hid as Unchanged (scoped exclusion table); events raised on genuinely Unchanged aggregates keep dispatching. - M29: EFRepository.Save()/SaveChangesAsync() route through the ApplicationDbContext user-id overloads so direct repository saves stamp the acting user, not the system sentinel. BugHunt ledger: M1, M6, M7, M29 (Common wave W1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018aXCqcfqf5Ka4hKWQphh3i
…roker publish, bounded warmup - M2: SafeDomainEventHandler rethrows via a log-and-rethrow filter instead of swallowing, so the advertised outbox retry/dead-letter path actually engages; class doc states the batch-redelivery consequence and the at-least-once contract subclasses must tolerate. - M8: a graceful-shutdown cancellation mid-batch now best-effort persists the in-memory ProcessedOn stamps (own try/catch, 5s bounded token) before propagating, closing the lease-expiry redelivery window for already-dispatched messages. - M32: BrokerEventBus batch publish stages every outbox row, saves once, signals once (mirrors InProcessEventBus); empty batches no-op. - M10: every warmup task is bounded (120s) so a hanging dependency lands on the log-and-continue path and the readiness gate always opens; timeout and time source injectable for tests. BugHunt ledger: M2, M8, M32, M10 (Common wave W2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018aXCqcfqf5Ka4hKWQphh3i
This was referenced Aug 1, 2026
Merged
ivanball
added a commit
that referenced
this pull request
Aug 1, 2026
BugHunt remediation release: changelog entry for the 24 fixes shipped in PRs #179 and #180, with the four behavioral changes called out (SafeDomainEventHandler rethrow, strict money payloads, audit actor stamping on direct saves, sort/pagination corrections). Claude-Session: https://claude.ai/code/session_018aXCqcfqf5Ka4hKWQphh3i Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of two MMCA.Common BugHunt remediation PRs (waves W1 persistence + W2 events/background). Every item was adversarially re-verified against source before implementation; several fixes were corrected by that pass (see ledger notes below).
TransactionCommitAmbiguousExceptioninstead of re-entering the retry delegate after a possibly durable commit (EF's retriability check walks inner exceptions, so the failure is returned past the strategy). Multi-source witness verification deferred and documented.SaveWithIdentityInsertAsynctemporarily hides (scoped exclusion table); events raised on genuinely Unchanged aggregates keep dispatching (blanket state filtering was disqualified: it would dropUserRegistered).EFRepository.Save()/SaveChangesAsync()route through theApplicationDbContextuser-id overloads so direct saves stamp the acting user.SafeDomainEventHandlerrethrows via a log-and-rethrow filter; the advertised outbox retry/dead-letter actually engages. Doc states the batch-redelivery consequence (at-least-once).ProcessedOnstamps (bounded 5s token, never replaces the OCE), closing the 300s lease-expiry redelivery window.BrokerEventBusbatch publish: one save, one signal, empty batches no-op (mirrorsInProcessEventBus)./health/readyclosed forever (replica-stuck-out-of-rotation fix).Verification
dotnet build MMCA.Common.slnxclean Debug + Release (five analyzers at error severity)dotnet test --solution MMCA.Common.slnx -c Release: 2547 passed, 0 failedTransactionCommitAmbiguousException)🤖 Generated with Claude Code
https://claude.ai/code/session_018aXCqcfqf5Ka4hKWQphh3i