docs: inbox-pattern.md + remove SQLite hold-transaction property#150
Conversation
Adds docs/inbox-pattern.md as the consumer-side counterpart to docs/outbox-pattern.md. Covers the IRelationalWorkerNotification capability cast, EnableHoldTransactionUntilMessageCommitted requirement, library-owned transaction lifecycle, and an explicit "not supported on SQLite — single- writer lock" callout per the structural lesson captured during PR #143. Also removes EnableHoldTransactionUntilMessageCommitted from the SqLiteMessageQueueTransportOptions public surface. The property was once user-settable but the read path silently went to a no-op when SQLite's inbox path was disabled long ago. Now satisfied via explicit ITransportOptions interface implementation: getter returns false, setter discarded. Variables typed as the concrete SQLite options class no longer see the property at all — compile error on attempted access surfaces the structural constraint at compile-time rather than via a silent no-op or warning. ITransportOptions-typed access still compiles (interface contract preserved); SqlServer and PostgreSQL options classes are unchanged. Breaking change is intentional and surfaces only the code path that was always broken — anyone who already set the property on SQLite was relying on behavior that never functioned. See issue #149 for the SQLite outbox follow-up (the outbox direction is viable because the caller chooses when to commit, not the library). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces the transactional inbox pattern for the DotNetWorkQueue library by documenting how handlers can achieve atomicity between dequeue and business writes via ChangesTransactional Inbox Pattern with SQLite Transport Constraint
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #150 +/- ##
==========================================
- Coverage 89.81% 89.78% -0.03%
==========================================
Files 1002 1002
Lines 29703 29703
Branches 2405 2405
==========================================
- Hits 26678 26670 -8
- Misses 2365 2368 +3
- Partials 660 665 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Two changes follow up on PR #143 (inbox milestone) + issue #149 (SQLite outbox-only):
docs/inbox-pattern.md— consumer-side counterpart todocs/outbox-pattern.md. Covers theIRelationalWorkerNotificationcapability cast, theEnableHoldTransactionUntilMessageCommittedrequirement, library-owned transaction lifecycle, supported-transports table, and an explicit "not supported on SQLite — single-writer lock" reference section. Includes sync + async SqlServer code examples and a PostgreSQL note.Remove
EnableHoldTransactionUntilMessageCommittedfromSqLiteMessageQueueTransportOptionspublic surface. The property was once user-settable but the receive path's no-op was added long ago when SQLite hold-transaction support was disabled. Property is now satisfied via explicitITransportOptionsinterface implementation only — variables typed as the concrete SQLite options class no longer see it, and direct access produces a compile error instead of silent no-op.ITransportOptions-typed access still compiles (getterfalse, setter discarded). SqlServer + PostgreSQL options classes are unchanged.Why now / motivation
The CLAUDE.md lesson committed in PR #143 captured the structural reason (single-writer lock) hold-transaction inbox can't work on SQLite. The property's continued presence on the SQLite-typed class was a footgun: code that set it on SQLite silently did nothing. Hiding it makes the impossibility visible at compile-time on the dangerous use path (
var opts = new SqLiteMessageQueueTransportOptions(); opts.EnableHoldTransactionUntilMessageCommitted = true;→ compile error).Breaking change
Yes — strictly limited to code that:
SqLiteMessageQueueTransportOptionsclass (notITransportOptions), ANDEnableHoldTransactionUntilMessageCommitted.Any such code was previously silently broken (the value never affected SQLite behavior). The compile error surfaces what was always true: this property is meaningless on SQLite.
Code that types as
ITransportOptionsstill compiles and the property still no-ops, so polymorphic configuration code is unaffected.What's deliberately NOT in this PR
Test plan
docs/inbox-pattern.md— code examples compile against current API (IRelationalWorkerNotification.Transaction,consumer.Start<T>(handler, null), etc.).🤖 Generated with Claude Code
Summary by CodeRabbit
Breaking Changes
EnableHoldTransactionUntilMessageCommittedproperty no longer directly accessible on the SQLite-specific options type.Documentation