mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
fix(studio): reconcile external edits before reload (#2993)
* fix(studio): reconcile external edits before reload * fix(ci): retry transient workspace installs Make external reload retry behavior honest and isolate reload listeners. Remove the dead SDK timestamp parameter.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { StudioFileConflictError } from "../utils/studioSaveDiagnostics";
|
||||
import { drainStudioSaveQueues } from "./usePreviewPersistence";
|
||||
|
||||
describe("drainStudioSaveQueues", () => {
|
||||
it("does not erase a pending-field conflict with a clean DOM queue", async () => {
|
||||
const conflict = new StudioFileConflictError({
|
||||
filePath: "index.html",
|
||||
currentVersion: "v2",
|
||||
currentContent: "external",
|
||||
attemptedContent: "studio",
|
||||
});
|
||||
const waitForDomQueue = vi.fn(async () => ({ status: "clean" as const }));
|
||||
|
||||
await expect(
|
||||
drainStudioSaveQueues(
|
||||
async () => ({ status: "conflict" as const, error: conflict }),
|
||||
waitForDomQueue,
|
||||
),
|
||||
).resolves.toEqual({ status: "conflict", error: conflict });
|
||||
expect(waitForDomQueue).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user