mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
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:
@@ -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/")) {
|
||||
|
||||
Reference in New Issue
Block a user