refactor(settings): station.settings SQL moves into StationSettingsRepository (gh-#406 slice 3) - #510
Merged
Conversation
…pository (gh-#406 slice 3)
Base automatically changed from
refactor/gh-406-s2-fontpack-error-contract
to
main
August 14, 2026 01:44
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
gh-#406 L2 burn-down, slice 3 of 5 — stacked on slice 2 (merge in order; merge commits, not squash). Slices 4 and 5 build on this seam.
⚖️ New
StationSettingsRepository(GenWave.MediaLibrary.Station) owns thestation.settingsrow I/O with byte-identical SQL. Deliberate deviation from theLazy<NpgsqlDataSource>wiring pattern: the ctor takes the plain connection string (documented in its remarks) — slices 4/5 need it constructible before and outside the DI container for the pre-DIIConfigurationProviderboot path.StationSettingsStorekeeps everything that is genuinely its own — the write-side allowlist guard, reload signal, change event, empty-connection-string degrade — and delegates the rows; no DI wiring change (StationSettingsHostingExtensionsuntouched).📝 One necessary posture translation: the store's read-side degrade catch was
NpgsqlException; it becomesDbException(verified:NpgsqlException : DbExceptionin the pinned Npgsql 10.0.3 — same failures caught,OperationCanceledExceptionstill propagates), since Host may no longer name Npgsql types. Documented in the method remarks.📉 Baseline row deleted (3 debt rows → 2: only the Provider and SeedMarker rows remain, for slices 5 and 4).
🧪 New db-backed
Story042_StationSettingsRepositoryspecs: insert, upsert-in-place,updated_atadvance, unfiltered read-all, case-insensitive lookup, round trip, PK-null sad path.✅ At stack tip: build 0 warnings; Architecture 104/104; MediaLibrary 763/763; Host 1723/1723 (settings overlay coverage unchanged and green); Core 144/144.