Closing an untouched untitled note can delete text written into it at the same moment
Author: AmoabaKelvinCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbugfile-editor
What happens
- 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
deleteUntouchedUntitledFileinsrc/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.tschecks the file's size and then deletes it, as two separate operations.- The delete operation (
files.deleteon 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. - Before #23768 this delete had no check at all, so #23768 narrowed the window but didn't close it.
Acceptance
- The untitled-note cleanup never deletes a file that has content, even when a write lands while the tab is closing.
- Works for local, SSH and remote Orca hosts, including a host running an older Orca version.
- Closing an untouched note that is still empty still removes it, as does Don't Save on a never-saved note.
- A test that fails if the fix is reverted.
Source: stablyai/orca