diff --git a/cmd/verstak-gui/sync_apply.go b/cmd/verstak-gui/sync_apply.go index 8d39bb6..375676a 100644 --- a/cmd/verstak-gui/sync_apply.go +++ b/cmd/verstak-gui/sync_apply.go @@ -207,7 +207,6 @@ func (a *App) ensureTemplateChildren(nodeID, templateID, parentFsPath, title str _ = os.MkdirAll(fullPath, 0o755) _ = a.activity.Record(nodeID, activity.TargetFolder, childNode.ID, "", activity.TypeNodeCreated, folderName, "") - _ = a.sync.RecordOp(syncsvc.EntityFolder, childNode.ID, syncsvc.OpCreate, nodePayload(childNode)) } for _, df := range tmpl.DefaultFiles { @@ -245,18 +244,6 @@ func (a *App) ensureTemplateChildren(nodeID, templateID, parentFsPath, title str `INSERT OR IGNORE INTO notes (node_id, file_id, format) VALUES (?,?,?)`, childNode.ID, fileID, "markdown") _ = a.activity.Record(nodeID, activity.TargetNote, childNode.ID, "", activity.TypeNoteCreated, fileTitle, "") - _ = a.sync.RecordOp(syncsvc.EntityNote, childNode.ID, syncsvc.OpCreate, map[string]interface{}{ - "node_id": childNode.ID, - "parent_id": nodeID, - "title": fileTitle, - "file_id": fileID, - "format": "markdown", - "content": content, - "filename": filepath.Base(fpath), - "path": relPath, - "created_at": nowRFC, - "updated_at": nowRFC, - }) } return nil } @@ -631,11 +618,11 @@ func (a *App) moveNodeFiles(n *nodes.Node, newParentID, now string) error { } type fileMove struct { - id string - oldPath string - oldAbs string - newRelPath string - newAbs string + id string + oldPath string + oldAbs string + newRelPath string + newAbs string } var fileMoves []fileMove frows, ferr := a.db.Query(`SELECT id, path FROM files WHERE node_id=?`, n.ID) diff --git a/cmd/verstak-gui/vault_layout_test.go b/cmd/verstak-gui/vault_layout_test.go index 0369da5..87cdaa8 100644 --- a/cmd/verstak-gui/vault_layout_test.go +++ b/cmd/verstak-gui/vault_layout_test.go @@ -1448,6 +1448,14 @@ func TestVaultLayout_TemplateChildrenBackwardCompat(t *testing.T) { } } } + + ops, err := app.sync.GetUnpushedOps() + if err != nil { + t.Fatalf("get unpushed ops: %v", err) + } + if len(ops) != 0 { + t.Fatalf("remote template apply recorded %d outgoing sync ops, want 0", len(ops)) + } } // --- helpers ---