feat(253): PR3 optimistic-concurrency fan-out — Diff + Scalar aggregates
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 5s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m11s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 9m51s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped

Fans the frozen Block recipe (api-conventions §7a) across the five Diff/Scalar
replace-all endpoints, completing the #253 PR2→PR4 arc's implementable core:

- #6 Collection custom-order, #7 Playout alternate-schedules, #8 Playout templates
  (shared Playout.Version), #9 MultiCollection, #10 RerunCollection — each: pre-check
  412 as a standalone Either after validation (H2, subtype survives the Join flatten),
  unconditional Version++ (M1), guarded save, controller If-Match/ETag/400/412, SPA
  editor ETag round-trip + 412 conflict dialog.
- H1: the two Playout handlers' catch(Exception)→422 restructured so the guard's
  PreconditionFailedError returns before the catch (412, not 422).
- M2: RerunCollection/Collection refresh runs unconditionally on save; MultiCollection
  keeps its name-only→no-rebuild optimization by bumping on the first (name) save.
- H3: UpdateDefaultDecoHandler bulk-bumps Playout.Version via .SetProperty.
- Shared ConcurrencyHeaders.MalformedIfMatchProblem() for the 400 guard.
- Deferred (→ #269): same-root non-bulk sibling config writers' ETag rotation.

Tests: per-handler pre-check/bump concurrency tests (Playout ×2 incl. non-vacuous
racing-save backstop, Rerun, Multi incl. name-only-no-rebuild M2, Collection);
controller tests get a DefaultHttpContext for the header read/write. Docs:
api-conventions §7a fan-out status, spa-conventions §4a list-editor note, decisions.

Refs #253

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 19:23:48 +02:00
co-authored by Claude Opus 4.8
parent 13cd00c8fe
commit c40ffefa99
56 changed files with 1349 additions and 130 deletions
+20 -3
View File
@@ -1,4 +1,4 @@
import { ApiError, request } from './client';
import { ApiError, request, requestWithMeta, type ResponseWithMeta } from './client';
import type { components } from './generated/v1';
export type MultiCollection = components['schemas']['MultiCollectionResponseModel'];
@@ -38,12 +38,29 @@ export function getMultiCollection(id: number): Promise<MultiCollection> {
return request<MultiCollection>(`/api/multi-collections/${id}`);
}
/** Load a single multi-collection together with its concurrency ETag (issue #253). */
export function getMultiCollectionWithMeta(id: number): Promise<ResponseWithMeta<MultiCollection>> {
return requestWithMeta<MultiCollection>(`/api/multi-collections/${id}`);
}
export function createMultiCollection(body: CreateMultiCollectionRequest): Promise<MultiCollection> {
return request<MultiCollection>('/api/multi-collections', { body, method: 'POST' });
}
export function updateMultiCollection(id: number, body: UpdateMultiCollectionRequest): Promise<MultiCollection> {
return request<MultiCollection>(`/api/multi-collections/${id}`, { body, method: 'PUT' });
/**
* Update a multi-collection. Pass the last-seen ETag as `If-Match` to reject a stale overwrite
* with 412; the resolved value carries the new ETag for a subsequent save (issue #253).
*/
export function updateMultiCollection(
id: number,
body: UpdateMultiCollectionRequest,
ifMatch?: string | null
): Promise<ResponseWithMeta<MultiCollection>> {
return requestWithMeta<MultiCollection>(`/api/multi-collections/${id}`, {
body,
method: 'PUT',
headers: ifMatch ? { 'If-Match': ifMatch } : undefined
});
}
export function deleteMultiCollection(id: number): Promise<void> {