Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#23772·orca

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

  1. Create a new untitled markdown note and don't type in it.
  2. 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.
  • 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

View original on GitHubView discussion on GitHub