+7

Data loss when network drive is unavailable

Jo Liss 12 years ago updated 12 years ago 5
Sublime Text 2.0.1 just emptied a bunch of files that I didn't have checked in yet:
* I restarted the system. ST had several open tabs.
* After the restart, the network drives that the files were on was not mounted, so ST displayed the files with empty content.
* Then the network drive (an SMB share) came up.
* I quit and re-opened ST, hoping to see my files now.
* But now they are all empty, as verified by `less`!
I'm really unhappy now. Please, don't lose my data.
Oh, it also asked me whether I want to reload, and to each file I said "yes".

I also have "save_on_focus_lost": true

I'd love if you could take a look. This was pretty scary, and cost me about an hour.

This is generic and depends on the network layer. I had this problem with gedit on an sshfs. I tend to use Transmit with a sound notification (so I know, after hitting cmd+s when the file is really saved). Never, ever use save_on_focus_lost, at least for remote files. Even on local files you will step into dangerous stuff..
+2

This is dangerous, I just lost all my work because of this.

When the network drive gets mounted, sublime ask if the user wants to reload, but it just overwrites the file on disk with a blank version. 


Great job reproducing, aristidesfl! That's exactly the problem I encountered.


The problem doesn't seem to be specific to network mounts. I've also seen it happen when git made the files disappear temporarily (changing branches for instance) - when they come back, they're nuked by ST2, like in the video.

Hey Jon, you should watch aristidesfl's video on this page - it demonstrates the bug perfectly!