Last night I experienced a terrible issue: I’ve lost a lot of local changes when I tried to synchronize the repository from Editor 2. First of all, a lot of new files were missing for staging and then files that were in the project for a long time already were reverted to their previous versions. I just did a regular synchronize procedure: clicked Synchronize in the menu, then click Pull. There were only ~3-5 files suggested for staging though I added much more (I don’t know if it matters, but I’ve added them not in the Editor, but manually, in Finder).
That was a very frustrating experience. Lucky me that I didn’t re-build the project after that and now I can recover my source code changes from .luac files. But I still will need to re-create all collections, game objects, and atlases.
Here are two screenshots from SourceTree (which I will use for Defold repositories now). On the first one, you can see some added files, that’s OK.
I never use Editor 2’s built in syncing because of losing trust in it early on with some data loss (and expecting it to eventually become solid). I always use sourcetree / github client and have never had an issue.
Of course this should absolutely not happen. If you have any pointers as to how we might reproduce this issue, it would be very helpful. Can you also see if there are any logs present that tells us what happened?
I will try to reproduce the issue later. For now, I will just use SourceTree to commit my changes. @AGulev also gave me the Github issue link with the similar problem, but in that case, there was at least a stash of all lost changes. But there was no stash in my repository, unfortunately.
Something similar happened to me, but I had the stash still available in the repo luckily. Not sure of the steps to reproduce, as I quickly acted in a late night programming boit haze to solve it.
The confusion started right after it was syncing and pulling, that I remember.
Indeed. Maybe @mats.gisselson or @Erik_Angelin could tell us a bit more about the built-in Git tool? Which Git operations are done and how? From the UI it seems to be simple pull, add+commit and push commands.
I think that the order of commands should be different: stage, commit to the local repository, pull from the remote, resolve conflicts (if any), push to the remote.
Now I think that I also could have a stash but I did a second commit after that because I started to restore the lost files. Maybe the stash was deleted on the second commit?
BTW, I already restored everything in my project. I quickly copied all the lost source changes from .luac files and then re-created atlases, tilemaps, and collections manually. It took me about one hour. Everything is fine now, but I’ll try to reproduce the issue in some other repository.
We are taking this very seriously and have our top people looking at what might have happened.
Do you remember more details of what the editor told you? Did you get an error pop-up? If so, what did it say? Or did you get an exception, or both?
And are you on Windows? Did you have something open in an external program? We check for file locks, for instance, but there may be corner cases there.
I didn’t get any exceptions or errors; it looked like a regular synchronization process. I’m using the latest macOS, and it is was the newest Editor 2 (1.2.122). As for something open: I have some files open in Sublime Text which I use for source code editing.
I will also try to reproduce the issue myself tomorrow on a test project. I’ll let you know if I get any results.
I may have found a repro case. It involves doing changes to the filesystem when the editor has just started the sync flow. Is it possible that you, through Sublime or some background process or something else did alter project files while you saw the following dialog?
I get this screen all the time! it’s driving me crazy!
I am not making any changes at all to the file system or anything. I can click “save all”, exit editor 2, and then reset my computer and re-open, and I still get the “Get Remote Changes” screen.
I assumed that was the first step of the error which is stopping me from synchronising.
After I click “pull”, I see this screen, and I am unable to click on anything other than cancel.
Hmm, or do you mean that it appears when the editor starts? That signals that the editor believes that there is a sync that has not finished properly and it tries to redo it.
Yes, that was the problem! I would say there are two slightly weird things: Firstly, the massive space in the “get remote changes” dialogue box makes me think something has gone wrong. And secondly, that second screen is a little confusing. It would be simpler to have “view difference”, “save ours” “save theirs” buttons next to each file, so you know what options are available (otherwise, you just assume it’s an error).
Nb. I had never used GitHub or any other automatic cloud storage system before Defold and it was one of the things that took me a little while to understand, especially because the benefits are not immediately obvious (And also because i privately feel like an understanding is assumed).
nb2. I also didn’t immediately understand what “push” and “done” mean, but we’ve gone off topic now, we might talk about this at a later time!