Code Disappeared or Lost

lost-code
revision-history

#1

The Problem

Sometimes user have instances where their code is gone, gets lost, disappears, etc. and it seems that hours of work is lost. No worries, a solution is detailed below, as well as a way to prevent this.

The Cause

This happens when the workspace is open on another PC (whether a collaborator or another session by the same user) and that PC has saved out its copy before syncing with the server. With that, consider some of the following questions:

  • Do you have that workspace open on any other computers?
  • Do you have autosave turned on?
  • Are there any other collaborators in the workspace and do they have autosave turned on
  • Did code get reverted to an earlier state or did complete files disappear?

Recovery

Use the revision history feature (only available in hosted workspaces, not SSH) to recover your code. If your file is completely deleted or gone, you can simply recreate that file and then use revision history.

Note that it must be the exact same file name (case sensitive) and location. If an entire folder is gone then you’ll need to recreate the folder and then create a file within that folder. From there, do the following.

  1. Click File > Show File Revision History
  2. Wait a second for the history to show up then go to the revision you want (usually 1 step back)
  3. Click Revert

Prevention

If you don’t have it open in 2 places at once, this won’t happen. If you close the IDE after use this also helps, as sometimes it reverts when the computer wakes up and the IDE reconnects and autosaves out the file.

Permanent Solution

We’re looking into a permanent fix for this so users don’t need to troubleshoot this. If you have any questions or thoughts on this then feel free to chime in.


Lost all the work in one of my files
Cloud 9 script rolled back
Code inconsistent across devices
Load new file message (don't say yes to the question!)
Code disappearing
Changes keep reverting to older versions
Can't Access Application
#5

This recently happened to me without having the workspace opened in two places and without putting my computer to sleep.


#6

It seems like check-and-set would be useful here: don’t save the file unless the client is aware of the most recent version. Couchbase has a system for this: http://developer.couchbase.com/documentation/server/current/sdks/dotnet-2.2/check-and-swap.html


#7

Just wanted to say thanks. It’s a very impressive feature and it helped me out a lot!


#8

This happened to me too, several times yesterday and today. I am working on only one machine at a time, no collaboration. Message says “All Changes Saved” but they are not, file is not being updated and reload shows new changes have vanished. Critical issue.


#9

I had a code-loss on 29th as well. And I remember closing all my windows after saving the files.

The file revision history had the code as of 28th end-of-day only, so I had to redo all that I’d done on 29th.

This is a fairly critical issue and is causing me to rethink using Cloud9, though I’ve otherwise been a very happy user!


#10

Oh my I though I’d lost my work! Thanks for this backup! It’s really working.


#11

This just happened to me today, so I apologize ahead of time for my frustration. I was working on a web project and, seemingly without cause, lost all the contents of my css file. The file revision history is great for recovery but I still lost quite a bit of work. Does this mean this issue has not yet been fixed? Or am I doing something wrong? I did not have my workspace open on multiple machines and autosave is kinda buried in the settings(it would be nice if this was more obvious to prevent such a critical issue) so I did not have it enabled. It would also be nice to be given some kind of incredibly obvious warning that this issue can happen and here’s how to prevent it.

Again, I apologize for any frustration you might get from this. Thanks in advance for taking the time to hear me out.


#12

Hi,

Experienced the following issues:

  1. Code disappearing from individual files (when working solo on one machine, one tab and when collaborating)
  2. Entire workspaces disappearing

Whilst the workaround to revert files to an earlier state is appreciated, a permanent fix is needed.

We are using c9 in a learning environment to collaborate with students (who are new to programming). Therefore, the loss of code (on c9) can cause confusion and sometimes unnecessary panic.

Please can you keep let me know (a) if a permanent fix is being worked on and (b) when we can expect that fix to be in place?

Thanks,
Nakita


#13

Hi everybody. Is there any permanent solution for this problem yet?