Web IDE: Huge Disaster, Tool rolled-back to old code

I’m REALLY hoping there is some way I can’t see to roll back to a previous version of code within the web IDE tool.

After making some tweaks, I re-logged back onto the web IDE. The tool mysteriously has rolled back to a very early version of my code. I appear to have lost quite a bit of work. Please tell me there is some way to roll back to a certain date (or similar version control). If not, I have to manually copy the files onto my local system in order to guarantee I have any particular version?

Why would any ever use the web IDE if things like this could occur? I am assuming nothing is able to be rolled-back. :frowning:

Ed

1 Like

@Dave may be able to help you with that - he did for me a while back (thanks again :+1:)

If you can give him a time frame when you last saved your good code, he might be able to pull that snapshot from the archives.


That sometimes happens when you switch machines or browser. The old code might be pulled from your browser cache and if you then save that state back, your remote version will be overwritten.
So if you notice that you’re seeing old code don’t try to save or build. Just select some other project of yours, go to the settings drawer of Build and press CLEAR CACHE. After that you should be able to go back to your project and see the current state.

1 Like

Hey @Ed_SanDiego,

Can you email me ( david at particle.io ) from your email account that you used to login to Particle, and send me the name of your project and if possible the url you see when you have the project open? It would also help to know the last date you saved the project and it was good, and potentially a keyword or two from when it was complete.

Thanks!
David

3 Likes

Okay, I sent the previous versions, I hope that helps! Looking forward to when this is all automated :slight_smile:

Thanks!
David

2 Likes

I cannot wait for some form of version control on the web IDE. A few weeks ago I also lost about an hours worth of coding after switching between my desktop and laptop.
Right now I am selecting code and saving it locally onto my computer (using Evernote) as a crude form of version control - definitely not ideal but gives me peace of mind.

@peter_howells, have you considered using Particle CLI to compile your local code? It uses the same build farm and add functionality that Build does not have.

@peekay123 I have considered and tried it. It did not suit me as I use 2 different computers, depending on where I am, for my development, and having the IDE cloud based is so much easier in this regard.

1 Like

Version control on the Web IDE is a definite “holy grail” but if you setup both your machines with git, use a 3rd party Git remote (like GitHub, BitBucket, GitLab, etc) you can sync all code changes between your machines AND use REAL version control. You also get to use git which lets you do cool thinks like branching so you can conduct little experiments without impacting you “mainline”, merging those branches back into the mainline, cherry-picking between experiments, and code commits that describe what you changed.

2 Likes

@harrisonhjones Thanks for the info. I will definitely look into it. I am right in assuming that using GitHub will allow me to use the offline IDE for compiling my code?

Yes, you will definitely want to read through a git primer. The standard process looks like this:

Setup

  1. Make a folder for your project.
  2. Make a repo for your project (on GitHub)
  3. Open a terminal in your project and then issue the command git init to initialize git in that folder.
  4. Issue the command git remote add origin <ssh or https url of the repo>. GitHub explains the exact command to use here.

Development (Everytime you sit down at either computer)

  1. Issue the command git pull origin master to pull down any changes you pushed to GitHub earlier (from your other computer perhaps)
  2. Add some files, make some changes.
  3. Issue the command git add <filename> or git add . (to add all changed files)
  4. Issue the command git commit -m "<commit message goes here>" to commit your changes (with a message)
  5. Issue the command git push origin master to push your commits to GitHub (you can make multiple commits [steps 2-4] between pushes)

That’s it. Sounds tedious but once you get used to it it’s super simple. Commit early, commit often!

1 Like

Ouch. Just setup up GitHub and tried to create a repo - all repos are public in the free version - not good (unless you are creating open-source projects).

Ah, sorry. Try bitbucket or (my new favorite) gitlab. Both offer free private repos (their interface isn’t quite as nice as GitHub however)

Will do. Thanks for the info.

1 Like

Peter, one last cool thing: I could this today Git Guide. Probably worth a read if you are just getting into git.

1 Like

I agree with harrisonhjones, Git is the way to go here. I use Git with a local repo (free) for all my source control. Just copy and paste when you are done for the day. The Git bash shell does take some getting use to, but you can handle it.

NEVER rely on cloud or remote servers to save your code!! Save early, save often.