agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

bug(downloads): removing a cancelled entry can trash a newer completed file

Open codebanditssss opened this issue 1 month ago • 0 comments

Removing an old cancelled download can trash a newer file that was downloaded successfully.

Repro

  1. Start downloading reused.txt, then cancel it.
  2. Wait for the partial file to disappear.
  3. Download reused.txt again and let it finish.
  4. Remove the cancelled entry from the download list.

The newer file disappears, but its entry still says completed. Removing the cancelled entry should leave the newer file alone.

Both entries keep the same save path. The remove action checks whether a file exists there, but not whether it belongs to a later download. See browser-download-manager.ts.

Test notes: Fedora 44, dd67f2d818. Reproduced with real Electron downloads from a local server, including the app's download settings. The earlier component test redirected trash to scratch storage; the app test used disposable files only.

Screenshots

The cancelled and completed downloads share the same filename.

The cancelled and completed downloads share the same filename.

After deleting the cancelled entry, the completed download cannot be opened.

After deleting the cancelled entry, the completed download cannot be opened.

codebanditssss avatar Oct 06 '26 18:10 codebanditssss