fix(studio): enforce optimistic file concurrency (#2156)

* fix(studio): enforce optimistic file concurrency

* fix(studio): harden conditional file writes

* fix(studio): honor explicit file preconditions

* test(producer): allow zero-ms encode timing
This commit is contained in:
James Russo
2026-07-15 18:07:04 -04:00
committed by GitHub
parent 35e623b4f3
commit 2417293dab
34 changed files with 838 additions and 72 deletions
@@ -36,10 +36,11 @@ export function createSplitFetchMock(
onSplit?.(path, JSON.parse(String(init?.body)) as SplitBody);
// Return content that differs from the original so `changed` is true.
const after = `${disk[path]}<!--split-->`;
const version = `"test-${path}-${after.length}"`;
disk[path] = after; // server writes the split to disk
return new Response(JSON.stringify({ ok: true, changed: true, content: after }), {
return new Response(JSON.stringify({ ok: true, changed: true, content: after, version }), {
status: 200,
headers: { "Content-Type": "application/json" },
headers: { "Content-Type": "application/json", ETag: version },
});
}
if (u.includes("/files/")) {