Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice
Unity's version control component has been upgraded to Plastic SCM.

Collab constantly losing changes.

Discussion in 'Unity Collaborate' started by DistUnityKeith, Feb 3, 2017.

  1. DistUnityKeith

    DistUnityKeith

    Joined:
    Nov 12, 2015
    Posts:
    5
    We are trying to use collab on a couple of projects and on a daily basis we seeing changes 'disappearing' without collab reporting conflicts etc. There is no reason why it would report conflicts since no one was changing the same parts of the scene, I reported a specific example of this a couple of days ago. https://fogbugz.unity3d.com/default.asp?876592_u46uftbj9hl8u60s

    We are also seeing an odd problem where one developer changes animation controllers and commits and then when these changes are synced other developers who have not touched the animation controllers immediately have 'updates' to these files to be uploaded. If these 'updates' are uploaded they basically revert what the original developer did. You are able to revert these changes and after a couple of uploads collab will accept that you aren't changing these files. But obviously sometimes the developers don't notice that they have these files in their changelists and simply submit, reverting work.

    Also, there is a feeling here that is it a requirement to restart Unity after an upload or download. I have seen it myself where the list of files to be updated in collab changes after a restart.

    So there is now a movement here to either switch back to using perforce in exclusive checkout mode on the scene files, which is a huge pain and wastes a lot of peoples time and entirely defeats the point of using collab at all. Or two, use Unity in what is a presumably pre-collab way and make as many prefabs as possible, as many scenes as possible (and use the additive scene loader) etc but again this is less than ideal. And in our case isn't going to affect our 'updated animator' issue.

    We would really like to use collab because using Unity as a team is quite hard any other way but we cannot use a tool that causes work to be lost.
     
    Romenics likes this.
  2. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi Keith!

    Yikes, that's awful! I'm sorry you're encountering lost data. I want to find out what's happening to your missing changes. You're right that Collab doesn't report conflicts if the same objects in the scene aren't touched by more than one person. You mentioned in your bug that it seemed like one developer kept having their changes getting lost and would need to check that the rest of the team was getting them. Were you able to roll back to any of the commits between 269 and 275 (just before the commit that lost changes from 269) and find those missing changes? Are you positive that no one else's changes touch those same files? Have other members on the team reported missing data? What diff/merge tool are you using?

    In your bug you also mentioned that you'll be turning more objects in your scenes into prefabs. That's actually a good rule of thumb when working in Unity since it helps to mitigate scene conflicts. I would highly encourage that workflow as it will help to better protect against any lost changes.

    It's interesting that you say you need to restart Unity after an upload or download in order for the list of changes to be accurate. Are you using any plugins that modify multiple files every time the game is run? That could be giving you false positives with regards to your list of changes. The ignore file feature in 5.6 can help to address those issues. Do you know which files in particular seem to not be detected as changed until after a restart?

    Lastly, you said that you would be giving the latest 5.6 beta a try to see if it resolved any of your issues. Have you had a chance to try it yet?

    Our team wants you to be confident with using Collab and understand that losing any data shakes that trust. This is a big deal for us too and we are eager to resolve it.
     
  3. DistUnityKeith

    DistUnityKeith

    Joined:
    Nov 12, 2015
    Posts:
    5
    Thanks for the response.

    The problems are across two projects and many developers its not just one developer seeing problems.

    So when you say 'Are you positive that no one else's changes touch those same files?'. Some of the changes were to scene files but they were not to the same objects within a scene file. Is it enough that many people were changing the same scene file? I assumed that collab did some merging?

    All the developers will have p4merge installed but I have never seen any perforce windows popup while using collab. Is collab using p4merge locally to merge files?

    The issue with restarting unity was in 'some' circumstances after a download (sync) public variables attached to scripts would show as zero in the editor, when no one had set them to zero. If you saved your scene they were then also saved as zero. The next upload also had the zero'ed vars.

    We aren't really able to try the 5.6 beta on a large enough scale for it to be useful, there are too many people doing 'proper' work to risk using the beta.

    Are you able to see my project and my files? I kind of assumed that you would be which was why I put the project id, file names and changelist number into the bug. In the hope that your server was also recording more information about what it did and why.

    If its a simple case of collab is simply unable to merge scene files at all then I guess we will switch everything over to the many scenes and many prefabs methods and then go back to perforce exclusive checkout as we have done on previously Unity projects and wait for collab to catch up.
     
  4. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    That's exactly what I mean, that no one modified the same objects in the same scene. Collab is able to merge smaller scenes automatically as long as the same objects weren't modified by more than one person. This is harder for larger scenes because the order of objects in the scene files aren't always consistent between saves, which can play havoc with most merge tools.

    It's OK that you haven't seen any p4merge windows. Collab uses YAMLMerge behind the scenes for any files that can be auto-merged. P4merge (or whichever diff/merge tool you specified in Preferences) will only be used if a conflict is detected, and then only when you select "Use external tool" to diff the changes when you mouse over the conflict in the Collab Toolbar.

    Woah, that's definitely not good. Were you able to go back to the commit before losing those vars and get them back? What about if you do a fresh checkout (download the project from the Cloud in a new location). Would you see the right values then?

    Fair enough. Totally understand.

    We actually are not able to see the contents of your project on our end. It's a privacy concern. We don't want users to think that we can just look at their source anytime we want. But we are able to see if your commits are successful and what errors you run into on our end so thank you for sharing your project ID.
    (Actually, we can look at your project, if you give us permission to do so. Sorry for the misinformation.)

    For now, you may be better off going with that method. It's actually a preferred Unity workflow to have most objects in your scenes be prefabs, since it's both easier to merge changes as well as to apply fixes to multiple instances at once. In the near future we plan to make merging of scenes easier and more intuitive.
     
    Last edited: Feb 7, 2017
  5. DistUnityKeith

    DistUnityKeith

    Joined:
    Nov 12, 2015
    Posts:
    5
    Thank-you for the clear explanation of how collab merging works.

    We'll certainly be breaking our scenes up in the future, but even then the possibility of data loss still exists so its hard to see how we could continue to use collab, re-doing work and untangling bad merges is not something we (or anyone) can afford to be doing.
     
  6. BigPapoo

    BigPapoo

    Joined:
    Jul 27, 2016
    Posts:
    13
    We are having troubles too with links being lost in some objects (Inspector). This is a big prob as we need to check all previously set links before publishing anything as some may be reset to null sometimes during the collab sync. This mainly occurs when a new object link is added or renamed btw, but not always. I didn't mentioned we are a 2 guys team.
     
    hoesterey likes this.
  7. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @BigPapoo! That's definitely a big problem and I'd like to get some more details about what's happening.

    Are you making sure to manually save your scene before publishing? Could you open your Collab History window and see if your scene files are among your list of changes?
     
  8. AndreiMarian

    AndreiMarian

    Joined:
    Jun 9, 2015
    Posts:
    77
    Hello, Ryan. I'm encountering a related problem meaning the added assets don't show up in the changes list. They're marked with the respective symbols over the icons in Project but they don't get listed in collab and they're not published.
    This is not solved by a restart of Unity.
    Is there a way to force a refresh of changes?
     
  9. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @AndreiMarian! I'm sorry that you're running into this issue. What type of assets were you adding to your project?

    You can try the following to get your toolbar updating again:
    1) Delete your Packages folder.
    (Mac) <username>/Library/Unity/Packages
    (Windows) <username>/AppData/Roaming/Unity/Packages

    2) Delete your Snapshot file.
    <ProjectDirectory>/Library/Collab/CollabSnapshot_....txt

    Let me know if either of these methods helped to unblock you.
     
    Extiward likes this.
  10. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    I've seen the same thing too. I've been keeping manual copies of my project so I can compare them between each publish. I noticed that sometimes lines of code go missing.

    Before publish
    Code (CSharp):
    1. public interface ICollectable{
    2.    void Collect();
    3. }
    After publish as is on the dashboard
    Code (CSharp):
    1. public interface
     
    ivanmkc likes this.
  11. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @ghostravnestorm! Thanks for the extra info. We'll be looking into a bug fix for this very soon.

    Were there any merge conflicts or other edits on this file in recent commits?
     
  12. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    Nope. That file in particular was created then published when this happened.
     
  13. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    That's very useful info for us. Would you mind submitting a bug through your project with the original file (by going to Help->Submit a bug)? Since you mentioned you were keeping manual copies of each revision. If you could include the file that has the missing lines of code with that bug report, that would be awesome! Then just mention your bug number here so that I can share it with the devs to help us find out what's going on.

    I really appreciate you going to all this effort.
     
  14. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    Do you have editor scripts that use GUID?
     
  15. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    Not editor scripts but mono behaviors, yes. I have an object pool framework where object pools have a guid that gets copied on to pool objects so when an object is returned, it checks that guid to know if it belongs to the pool.
     
  16. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    I wonder if it's related to one of the problems I've had with collab, it seems to shuffle GUID in certain conditions.
     
  17. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    I saw in your more recent thread that you have been using Collab while ignoring your meta files. Those files are important for Collab (and any source control or project sharing option for Unity) and can result in unintended behavior if tampered with or ignored. I'd like to rule out that the meta files being ignored were the cause of the missing code getting pushed. Could you keep an eye out for this same issue during your workflow after including your meta files please?
     
  18. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Do you happen to have any details on which scenarios your GUIDs seem to be shuffled?
     
  19. ghostravenstorm

    ghostravenstorm

    Joined:
    Oct 18, 2015
    Posts:
    88
    Quick update on this: I've also been managing a git repo from within my Unity project just so I can have finer control over source code. I noticed that switching to another branch makes Collab think I made changes to everything in the directory I'm have git setup in. I've made a local git repo out of the Scripts directory which I'm beginning to think has also lead to a lot of this undefined behavior from Collab
     
  20. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    @ghostravnestorm Thank you for the update. While it generally isn't recommended to use other source control methods along with Collab, there are ways to use it safely if you turn off any auto sync settings in your non-Collab tool (such as in Dropbox). A good workflow is to publish changes in Collab, close Unity, manually sync changes in Git or Dropbox, then reopen Unity and continue working. I hope that helps to minimize unexpected behavior in the future.
     
  21. FizzyJmo

    FizzyJmo

    Joined:
    Sep 27, 2014
    Posts:
    3
    Hey. I am using Collab on my PC and laptop. I recently published all my changes from my laptop to my pc. When I subsequently went to work on my PC some changes I made were not reflected there. Specifically, changes having to do with animations:

    - Unchecking loop time in the inspector for the animation was lost. All loop time check boxes were re-ticked when I opened the project on my PC.
    - All events that I created in the Animation screen were lost. These events called a particular function in a script.

    Are these issues know? Is collab particularly buggy like this?

    I am running: Unity 2017.1.0p4 Personal(64bit)

    Thanks.
     
    Last edited: Aug 25, 2017
  22. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @FizzyJmo! I'm sorry you're running into these issues. I tried to repro them on my machine but they seem to be syncing fine on my end. Do you have a small project you'd like to share that repros these issues?
     
  23. FizzyJmo

    FizzyJmo

    Joined:
    Sep 27, 2014
    Posts:
    3
    Hey @ryanc-unity. Thanks for testing it out on your machine. I remade the changes on my laptop and uploaded them again. This time they seemed to have stuck. It is a little concerning that that had happened. If I do run into this problem again I will repost here and let you know. Thanks.
     
    Ryan-Unity likes this.
  24. TSC_Lindy

    TSC_Lindy

    Joined:
    Mar 6, 2017
    Posts:
    6
    I just want to add here that we keep losing our Player Settings and have to uncheck the checkbox for Virtual Reality non-stop before committing, which is frustrating.

    Plus it gives this error until the checkbox is unchecked:
    XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: "Installation path could not be located (110)"!

    I hope this will be recognized in future commits :)