feat(canvas): 画布同步 - 新增操作事务、预演保存与并发恢复能力

This commit is contained in:
ddcat666
2026-10-11 22:19:20 +08:00
parent 6dedc5973c
commit 5f359f2b1d
63 changed files with 3235 additions and 6193 deletions

View File

@@ -61,8 +61,9 @@ func TestUndoCloudAgentCanvasRestoresLatestMutationAndIsIdempotent(t *testing.T)
t.Fatalf("unexpected undo result: %+v", result)
}
restored, _ := s.repo.CanvasProjectForUser("user", "agent-canvas")
if restored.PayloadJSON != canvas.PayloadJSON {
t.Fatal("undo did not restore the exact before snapshot")
restoredDoc, err := creationDocument(restored.PayloadJSON)
if err != nil || cloudAgentCanvasHash(restoredDoc) != beforeHash {
t.Fatal("undo did not restore the semantic before snapshot")
}
result, err = s.UndoCloudAgentCanvas("user", run.ID, call.ID, beforeHash, "重复请求")
if err != nil || result["accepted"] != true {