Skip to content

refactor(settings): station.settings SQL moves into StationSettingsRepository (gh-#406 slice 3) - #510

Merged
genwave-radio merged 2 commits into
mainfrom
refactor/gh-406-s3-settings-repository
Aug 14, 2026
Merged

refactor(settings): station.settings SQL moves into StationSettingsRepository (gh-#406 slice 3)#510
genwave-radio merged 2 commits into
mainfrom
refactor/gh-406-s3-settings-repository

Conversation

@genwave-radio

Copy link
Copy Markdown
Collaborator

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 the station.settings row I/O with byte-identical SQL. Deliberate deviation from the Lazy<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-DI IConfigurationProvider boot path. StationSettingsStore keeps 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 (StationSettingsHostingExtensions untouched).

📝 One necessary posture translation: the store's read-side degrade catch was NpgsqlException; it becomes DbException (verified: NpgsqlException : DbException in the pinned Npgsql 10.0.3 — same failures caught, OperationCanceledException still 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_StationSettingsRepository specs: insert, upsert-in-place, updated_at advance, 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.

@genwave-radio
genwave-radio merged commit 425cc07 into main Aug 14, 2026
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant