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:
@@ -113,4 +113,30 @@ describe("ExternalFileConflictBanner", () => {
|
||||
|
||||
await act(async () => root.unmount());
|
||||
});
|
||||
|
||||
it("does not offer retry when a failed DOM edit has no recoverable source candidate", async () => {
|
||||
const container = document.createElement("div");
|
||||
document.body.append(container);
|
||||
const root = createRoot(container);
|
||||
const coordinator: ExternalFileChangeCoordinatorHandle = {
|
||||
blocked: {
|
||||
status: "failed",
|
||||
generation: 1,
|
||||
path: "index.html",
|
||||
error: new Error("offline"),
|
||||
payload: { path: "index.html", version: "v2", content: "external" },
|
||||
studioContent: null,
|
||||
recovered: false,
|
||||
},
|
||||
retry: vi.fn(async () => undefined),
|
||||
useExternalFile: vi.fn(async () => undefined),
|
||||
keepStudioFile: vi.fn(async () => undefined),
|
||||
};
|
||||
|
||||
await act(async () => root.render(<ExternalFileConflictBanner coordinator={coordinator} />));
|
||||
expect(document.body.textContent).not.toContain("Retry save");
|
||||
expect(document.body.textContent).toContain("Discard Studio edits and reload file");
|
||||
|
||||
await act(async () => root.unmount());
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user