From 7ffc12b213fd4c9bd341ba63624ea8fc874c2ac5 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 11 Jul 2026 20:58:27 +0200 Subject: [PATCH] =?UTF-8?q?docs(handoff):=20lore=20=E2=80=94=20activating?= =?UTF-8?q?=20IsConcurrencyToken=20exposes=20all=20root=20writers=20(#253?= =?UTF-8?q?=20PR3=20review)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/handoffs/chicorytv-issue-queue.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/handoffs/chicorytv-issue-queue.md b/docs/handoffs/chicorytv-issue-queue.md index 409c11258..3c66cd7e0 100644 --- a/docs/handoffs/chicorytv-issue-queue.md +++ b/docs/handoffs/chicorytv-issue-queue.md @@ -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.