Skip to content

feat: Register IEventOutbox as SQLiteEventOutbox in AddSQLiteOutbox()#371

Merged
samtrion merged 4 commits intomainfrom
copilot/feat-register-ieventoutbox-sqliteeventoutbox
Apr 13, 2026
Merged

feat: Register IEventOutbox as SQLiteEventOutbox in AddSQLiteOutbox()#371
samtrion merged 4 commits intomainfrom
copilot/feat-register-ieventoutbox-sqliteeventoutbox

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

IEventOutbox was not registered when using SQLite, causing DI to fall back to OutboxEventStore without the SQLite-specific transaction scope wiring. Mirrors the SQL Server and PostgreSQL provider patterns.

Changes

New: SQLiteEventOutbox

  • Public IEventOutbox implementation for SQLite — delegates to IOutboxRepository.AddAsync(), which enlists in any active SqliteTransaction via IOutboxTransactionScope
  • Validates correlation ID length, serializes event to JSON, creates OutboxMessage with Pending status

New: AddSQLiteOutbox() overloads

  • Three overloads (connection string, Func<IServiceProvider, string> factory, Action<OutboxOptions>) — all call AddOutbox() internally and register IEventOutbox → SQLiteEventOutbox (Scoped)
  • UseSQLiteOutbox() retained for backward compatibility

New: AddSQLiteOutboxTransactionScope<TUnitOfWork>()

  • Registers the UoW as IOutboxTransactionScope (Scoped) so SQLiteEventOutbox enlists in the caller's SqliteTransaction automatically
services.AddPulse(config => config
    .AddSQLiteOutbox("Data Source=outbox.db")
    .AddSQLiteOutboxTransactionScope<MyDbContext>()
);
// IEventOutbox now resolves as SQLiteEventOutbox

Tests

  • SQLiteEventOutboxTests: constructor validation, StoreAsync with/without transaction scope, correlation ID overflow, stored message field assertions
  • SQLiteExtensionsTests: registration assertions for all three overloads, verifies IEventOutbox → SQLiteEventOutbox (Scoped), AddSQLiteOutboxTransactionScope coverage
  • SQLiteAdoNetOutboxTests: integration tests mirroring SqlServerAdoNetOutboxTests — uses SQLiteAdoNetInitializer to create the outbox schema via ADO.NET and configures AddSQLiteOutbox(connectionString), inheriting the full OutboxTestsBase test suite

Copilot AI linked an issue Apr 13, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Register IEventOutbox as SQLiteEventOutbox in AddSQLiteOutbox feat: Register IEventOutbox as SQLiteEventOutbox in AddSQLiteOutbox() Apr 13, 2026
Copilot AI requested a review from samtrion April 13, 2026 18:38
@samtrion samtrion force-pushed the copilot/feat-register-ieventoutbox-sqliteeventoutbox branch from 08a3a55 to 864976d Compare April 13, 2026 18:50
@samtrion samtrion added state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:feature Indicates a new feature or enhancement to be added. labels Apr 13, 2026
@samtrion samtrion marked this pull request as ready for review April 13, 2026 18:53
@samtrion samtrion requested a review from a team as a code owner April 13, 2026 18:53
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 95.16129% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (bfbc314) to head (0954aae).

Files with missing lines Patch % Lines
src/NetEvolve.Pulse.SQLite/SQLiteExtensions.cs 91.17% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
+ Coverage   84.98%   85.34%   +0.35%     
==========================================
  Files         106      107       +1     
  Lines        3837     3897      +60     
  Branches      351      354       +3     
==========================================
+ Hits         3261     3326      +65     
+ Misses        489      485       -4     
+ Partials       87       86       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samtrion
Copy link
Copy Markdown
Contributor

@copilot Also add Integration tests similar to SqlServerAdoNetOutboxTests

Copilot AI and others added 2 commits April 13, 2026 19:12
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 13, 2026

@copilot Also add Integration tests similar to SqlServerAdoNetOutboxTests

Added in commit 0954aae. The new tests include:

  • SQLiteAdoNetInitializer — creates the outbox schema inline via ADO.NET (no SQLite CLI dependency) and configures AddSQLiteOutbox(connectionString)
  • SQLiteAdoNetOutboxTests — inherits all tests from OutboxTestsBase via [InheritsTests], tagged [TestGroup("SQLite")] / [TestGroup("AdoNet")]
  • Verified snapshot for Should_Persist_Expected_Messages

All 203 integration tests pass.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1.0.17.172.in-addr.arpa
    • Triggering command: /usr/sbin/mysqld mysqld (dns block)
    • Triggering command: /usr/sbin/mysqld mysqld -container-port 3306 -use-listen-fd conf�� get &#34;&#34;); print; exit--log-format 27ecef881185f3f6527092eb8026cd57b1f/log.json listen_addresses/usr/bin/sh 8701e97fb4c43026-c (dns block)
    • Triggering command: /usr/sbin/mysqld mysqld ntime.v2.task/monew d46f82c88308eb3aconsole e13/log.json /usr�� ests.Integration/tmp/codeql-scratch-76ad07fa0b56cd26/dbs/csharp/working/E2C59699B0DF03A6753D2D7Fbash /var/run/docker/runtime-runc/mobjson false /run/containerd//usr/bin/sh --log-format json bash ff5e�� mysqld [^ \t]&#43;[ \t]&#43;/, &#34;&#34;); print; exit-d /usr/lib/networkd-dispatcher/off168.63.129.16 53CAB41B2457FC91bash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@samtrion samtrion merged commit 5c5cf53 into main Apr 13, 2026
8 of 9 checks passed
@samtrion samtrion deleted the copilot/feat-register-ieventoutbox-sqliteeventoutbox branch April 13, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:feature Indicates a new feature or enhancement to be added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Register IEventOutbox as SQLiteEventOutbox in AddSQLiteOutbox()

2 participants