fix(localdb): DI review fixes — onReady leak guard, BusyTimeoutMs ctor guard, shared allow-list

This commit is contained in:
Joseph Doherty
2026-07-17 21:47:28 -04:00
parent 529585163c
commit 4f9982c53f
6 changed files with 53 additions and 12 deletions
@@ -294,6 +294,8 @@ END;
**Steps (TDD):** tests: `AddZbLocalDb_ResolvesILocalDb_Singleton`, `AddZbLocalDb_WithRegistrations_TablesRegisteredOnStart`, `Validator_EmptyPath_Fails`, `Validator_NonPositiveBusyTimeout_Fails`. Implement `AddZbLocalDb(IConfiguration config, Action<LocalDbRegistrationBuilder>? register = null)`: binds `LocalDb` section, `IValidateOptions` validator (plain `IValidateOptions<LocalDbOptions>` — do NOT take a package dep on `ZB.MOM.WW.Configuration`; keep this lib dependency-light like Audit), registers `SqliteLocalDb` as singleton `ILocalDb`; the builder collects table names, applied at first resolution. Commit `feat(localdb): options validation + AddZbLocalDb DI`.
> **Shipped deviation:** the registration callback shipped as a plain `Action<ILocalDb>? onReady` (invoked once at first resolution, where consumers create tables + call `RegisterReplicated`) instead of the planned `Action<LocalDbRegistrationBuilder>` — the builder indirection added no value over handing consumers the `ILocalDb` directly.
---
### Task 7: Contracts — localdb_sync.v1 proto