diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 14:33:21 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 14:33:21 -0500 |
| commit | 8c1eb454154451223aeaa0d0ed8751dcc3d4ff78 (patch) | |
| tree | e79305938a8b256dadc5ad3161616863276b0095 /scripts/calendar_sync_api.py | |
| parent | de709102faa04b9221226572cec9d30affc143fe (diff) | |
| download | dotemacs-8c1eb454154451223aeaa0d0ed8751dcc3d4ff78.tar.gz dotemacs-8c1eb454154451223aeaa0d0ed8751dcc3d4ff78.zip | |
fix(org-roam): guard move-branch-to-roam against data loss
cj/move-org-branch-to-roam cut the subtree from the source buffer before writing the new roam file, so a failure in the demote/format/write/db-sync steps left the subtree gone from the source and not persisted anywhere — a destructive operation with no rollback.
Reordered so the node file is written and verified on disk before org-cut-subtree runs; a failed write now aborts with the source untouched. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= cj/move-org-branch-confirm-lines, 30) or buffers with unsaved changes. The source buffer is deliberately left modified and undoable rather than auto-saved, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir; the existing creates-roam-file test gained the confirm mock.
Diffstat (limited to 'scripts/calendar_sync_api.py')
0 files changed, 0 insertions, 0 deletions
