refactor(schedule): 23503 race mapping moves behind the repository seam (gh-#406 slice 1) - #508
Merged
Merged
Conversation
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 1 of 5 (stack: merge this first; merge commits, not squash — each later slice's PR is based on the previous branch).
⚖️
ScheduleControllerwas L2-exempt for catchingPostgresException23503 (the validated-persona-deleted-mid-PUT race). The catch moves intoScheduleRepository.ReplaceWeekAsync(mirroringPersonaRepository's idiom), which logs the WARN with the full exception — the zero-information-loss placement, since only the repository sees it now — and returns the newScheduleReplaceResult.PersonaVanishedcase. Controller switches on the case → byte-identical 409.using Npgsqlgone from Host.📉 Baseline row deleted (5 debt rows → 4). Also retires Story317's stale "unlike Story240's PostgresException-scripting idiom" prose — Story240 now scripts the typed case like everything else.
🧪 New db spec maps a real 23503 to the case deterministically (via the unvalidated
show_idFK — same SQLSTATE, no cross-connection race choreography needed; the catch matches SQLSTATE only).✅ At stack tip: build 0 warnings; Architecture 104/104; MediaLibrary 763/763 (full db suite); Host 1723/1723 (full); Core 144/144.