docs(handoff): lore — activating IsConcurrencyToken exposes all root writers (#253 PR3 review)
Build ErsatzTV Image / Docs update reminder (push) Has been skipped
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 4m47s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 6m13s
Build ErsatzTV Image / Build & push image (amd64) (push) Has been cancelled

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 20:58:27 +02:00
co-authored by Claude Opus 4.8
parent 22440cc1e6
commit 7ffc12b213
+14
View File
@@ -229,3 +229,17 @@ HARD CONSTRAINTS:
media source (fixed loop order), prescribing the shipped library-scan §C7 pattern instead (lock once per
provider, batch-enqueue, release on the `Unlock: isLast` message). Escalate the FIX approach too, not just
the finding.
- **Activating an `IsConcurrencyToken` exposes EVERY writer of that root, not just the opt-in ones**
(2026-07-11, #253 PR3, review-caught HIGH): once ANY handler bumps a root's version (making the token
live), EF appends `WHERE Version=@orig` to *every* UPDATE/DELETE of that row — so a *separate*
root-scalar writer that saves via plain `SaveChangesAsync` (and doesn't even bump) now throws
`DbUpdateConcurrencyException`→500 on a concurrent bump. Block (PR1) had a single root writer → no
exposure, which is why PR1/PR2 reviews didn't flag it; Playout/Collection (PR3) have several
(settings/schedule-file/checkpoint/name vs. the bumping alt-sched/template/deco/custom-order) → real
two-tab 500. Fix pattern: `ConcurrencyExtensions.SaveChangesForcingVersion` — on conflict, adopt the
stored token as BOTH `OriginalValue` and `CurrentValue` on each `IVersionedAggregate` entry and retry
(client-wins merge scoped to the token; Phase-1 force-write for a missing If-Match; never reverts the
concurrent bump). When you activate a token on aggregate X, grep for ALL other root-scalar UPDATE/DELETE
writers of X (not just the editor) and force-write or guard them. **Suspected open case: PR2's
`ProgramSchedule`** (`UpdateProgramScheduleHandler` vs. the bumping `ReplaceProgramScheduleItems`) — audit
for #197/#269/PR4.