mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 16:37:32 +00:00
fix(studio-server): a timed-out history save says it may still land, so callers don't retry blindly (#8300)
This commit is contained in:
@@ -140,7 +140,13 @@ async function updateState(dir: string, update: (state: VideoState) => void): Pr
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
const gaveUp = new Promise<never>((_, reject) => {
|
||||
timer = setTimeout(
|
||||
() => reject(new Error(`The video state did not answer within ${STATE_WAIT_MS} ms.`)),
|
||||
() =>
|
||||
reject(
|
||||
new Error(
|
||||
`The video state did not answer within ${STATE_WAIT_MS} ms. The save may still land later, so save ` +
|
||||
"again only through updateState, which waits for it.",
|
||||
),
|
||||
),
|
||||
STATE_WAIT_MS,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ it.skipIf(process.platform === "win32")(
|
||||
for (let turn = 0; turn < 5; turn++) await new Promise((next) => setImmediate(next));
|
||||
expect(settled).toBe(false);
|
||||
await vi.advanceTimersByTimeAsync(5000);
|
||||
expect(await outcome).toMatch(/did not answer within 5000 ms/);
|
||||
expect(await outcome).toMatch(/did not answer within 5000 ms\. The save may still land later/);
|
||||
vi.useRealTimers();
|
||||
|
||||
// The drive answers: the given-up write finishes and frees the lock, so the next write takes it (one still held
|
||||
|
||||
Reference in New Issue
Block a user