You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Closing an untouched untitled note can delete text written into it at the same moment #23772
Create a new untitled markdown note and don't type in it.
Close its tab at the same moment an agent or another program writes text into its untitled.md.
Actual: if the write lands between Orca checking that the file is still empty and Orca deleting it, the new text is deleted. Expected: closing an untitled note never deletes a file that has content.
The window is one file operation long: very short on a local disk, longer over SSH or to a remote Orca host. Found in review of #23768; not reproduced in practice.
Why
deleteUntouchedUntitledFile in src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts checks the file's size and then deletes it, as two separate operations.
The delete operation (files.delete on remote hosts, and the local and SSH delete paths) has no way to say "only delete if the file is still empty or unchanged". A write that lands between the two steps is lost.
Took this one as the same fix as #23771 — they are two ends of one defect.
Opened PR #51147. The cleanup no longer checks size and deletes as two requests: files.deleteIfUnchanged pins the empty bytes and, on the machine that owns the file, unlinks it while the checked file's handle is still open, so a write that lands in between can never be what gets deleted. A host that cannot guard the delete (older paired server, or an SSH-owned worktree) keeps the empty placeholder instead of deleting something it could not verify.
Activity
2SinceJuly commentedon Nov 27, 2026
Took this one as the same fix as #23771 — they are two ends of one defect.
Opened PR #51147. The cleanup no longer checks size and deletes as two requests:
files.deleteIfUnchangedpins the empty bytes and, on the machine that owns the file, unlinks it while the checked file's handle is still open, so a write that lands in between can never be what gets deleted. A host that cannot guard the delete (older paired server, or an SSH-owned worktree) keeps the empty placeholder instead of deleting something it could not verify.