You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make ReadModelDomainEventHandler idempotent for MerchantFeeSettledEvent duplicate inserts #1872
Background\n\nTransactionProcessor#1864 shows a UniqueConstraintException while handling MerchantFeeSettledEvent in ReadModelDomainEventHandler. The observed failure is a unique constraint violation coming from the SQL read-model path.\n\nRelevant code:\n- TransactionProcessor.BusinessLogic/EventHandling/ReadModelDomainEventHandler.cs\n- TransactionProcessor.Repository/ITransactionProcessorReadModelRepository.cs\n\n## Problem\n\nThe event handling path appears to be inserting a record that already exists, or otherwise re-processing a domain event without an idempotent guard. That turns a data consistency condition into a failed event-handling run.\n\n## Scope\n\n- Review the MerchantFeeSettledEvent / related read-model insert path for duplicate handling.\n- Make the handler or repository idempotent where the event is a replay or duplicate.\n- Add regression coverage for the duplicate/unique-constraint case.\n\n## Acceptance criteria\n\n- Duplicate processing of the merchant-fee-settled read-model path does not throw a unique-constraint exception.\n- The handler logs or returns a clear duplicate/replay outcome instead of failing the whole event-processing path.\n- A regression test covers the duplicate insert case.\n\n## Traceability\n\n- Originating issue: TransactionProcessor#1864
Activity