careteditor / issues

Caret issues
https://caret.io
326 stars 12 forks source link

Data loss when inadvertently overwriting file by new file with identical name #839

Open lensbart opened 5 years ago

lensbart commented 5 years ago

Steps to reproduce:

  1. Create a test file Watskeburt.md and enter some text of your choice
  2. Close this file by pressing Cmd + W
  3. Do some other work and forget about having created this file
  4. Right-click the folder that contains our freshly made file and select “New file”
  5. Type Watskeburt or Watskeburt.md and hit Enter
  6. Instead of getting a prompt asking whether to overwrite the existing file, or an error message saying we can’t save because there’s already a file with the same name, Watskeburt.md automatically gets overwritten and we see that the new file doesn’t contain any text. We also can’t retrieve the old text via the usual shortcut Cmd + Z.

While this might seem like an edge case, I ran into this issue because I have several files named “Meeting Notes YYYY-MM-DD” and accidentally created a file called Meeting Notes in a folder that already had such a file, (i.e. without the date). The file tree can obstruct the view of the entire file name, so I didn’t see that there already was a file with the same name. (Luckily, the files were in a Dropbox folder, so I could download a backup of the erased file).

Keep on making great software 👊😎👊

macOS Mojave version 10.14 Caret Beta version 4.0.0-rc21 (4.0.0-rc21)

astoilkov commented 5 years ago

Hi Bart,

Thanks for the well-described issue. We replicated the problem and will fix it for the next release.

We have some big surprises for the next big release so stay excited!