Undo defect? Undo make my file back to status when I open it


#1

Background: I was writing a latex file on my MAC using Atom last night. And I also opened that same file in my Windows machine using CTex. That file is in my dropbox, so once I save changes in my MAC, I can get it on my Win(I don’t know why I have to do this last night, but this is how the issue occurred).

The issue was happened in this way: I opened up the Atom on maybe 7pm, and the file is always opening in my Windows machine( actually I didn’t do anything on my win machine, only occasionally refresh that file). At 11 pm or so, I was copy and paste some codes in order to get a right figures order in my latex file, and I didn’t satisfied with my latest change so I hit the undo.

Then it happened, at the first glance I think my Mac is stuck for some reason, because the Atom just stuck there(my Mac is 16GB RAM, I don’t think an undo will make things crash). I was afraid about losing anything so I hit the shortcut of save file in Atom even if the Atom is stuck there.

After a while, maybe 30 sec, I found the terrible thing is that my file return(undo) to the state when it is 7pm when I open it, and I just hit the save file shortcut moment before!!! Hopefully I can track the modification history in Dropbox so I restored my file from 30 minutes earlier status. But I still lose all my changes in the last 30 minutes.

Just out of curiosity, I randomly do some changes to my file and hit the undo again. The same thing happened, but I did not hit save file this time XD…

I was trying to work out something before the deadline last night, so I did not do further research to this. Maybe later tonight I will try to reproduce this issue again to see if it is really an Atom issue.

I am not sure if this is because of Dropbox or the same file I open on my Win machine. But I cannot figure why it return to the status when I firstly on 7pm. I occasionally check my Win CTex so the status on my Win maybe like 10pm version or so.


Undo/redo broken
#2

I’ve never seen Atom revert four hours worth of changes with a single press of Undo. Then again, I don’t edit files directly in Dropbox. It is possible perhaps that Dropbox constantly syncing the file would alter the Undo stack somehow?

@ProbablyCorey who would be the right person to take a look at this?


#3

I’m not exactly sure why undo would cause Atom to hang, it is a pretty basic operation so I think it has something to do with Dropbox.

@ourlord, do you have autosave enabled? That may have also been a factor with this problem.


#4

Do you mean auto save in Atom? I don’t think I turn on auto save either on Atom or the software I used to open that file on Windows. But the interesting thing is that Dropbox recorded each save I manually done, no any auto save recorded.

@ProbablyCorey I think this must be something with Dropbox. Never run into such situation if I was editing a local file.

@leedohm Yeah, maybe it’s really not a good habits to edit file in Dropbox…Fortunately only lost 30 minutes work…


#5

Hi,
I have the same problem with python files, normal text doesn’t happen.
Might it be that it’s some package interference with ‘undo’? - linter or language-python?
I am running Debian Testing.
Installed Atom with Ubuntu Trusty ppa from webupd8team.


#7

So it seems like not a problem with Dropbox? Hmmm…
I have lang-python on my Atom. But at that time this issue happened I was editing LaTeX files.


#8

I just experienced this.

I’m not using dropbox, just editing a js file directly on harddisk.

I hit the undo shortcut, the editor froze for a moment then it went back to a state from two hours ago - and the redo command won’t return it.

Luckily I did a git commit an hour ago, so not all is lost, but I still lost an hours work.

Is there any sort of log file that might hint at what happened?


#9

@delameko Exactly the same scenario. It froze for a moment and everything is gone…


#10

@delameko and @ourlord

Have you followed the suggestions in the Debugging document? Also, could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Have you been able reproduced the issue?

The theory was that what caused the issue was hitting Cmd+Alt+Z was causing Atom to revert to an older version of the file. So we added a confirmation dialog to that flow in atom/atom#3169 which was released in Atom v0.122.0.


#11

I just checked the debugging document - I wish I’d thought to check the console before I shut Atom down.

  • I think it was 0.124.0, as I saw it was doing an update but I didn’t restart it, and I used it last week so it should have updated to the previous version then.
  • OSX 10.9.4
  • Unfortunately I couldn’t risk losing my work again yesterday, so I switched back to vim. I’ve got a personal project I’ll be working on tomorrow, I’ll try it out and see if it happens again.

I just tried cmd+alt+z and I got the prompt, so I doubt it was that. But then I see there was an issue with vim-mode, and I have that installed, so maybe its that. I’ll report back if it happens again.


#12

The issue happened to me month ago and that device is not longer belongs to me now so I don’t know which version of Atom exactly is but I am pretty sure was the lastest version at that time. The operating system is OSX. I tried to reproduce the issue but seems not happen.