Search Unity

Prefab modifications are constantly changing serialized data order and cause version control noise

Discussion in 'Prefabs' started by Xarbrough, Aug 5, 2019.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    483
    I believe I have already seen this issue as a bug report somewhere, but cannot find it anymore. Please let me know if this is being worked on or if anyone has any ideas what to do against this:

    PrefabModificationsRandomOrder.jpg

    We are on Unity 2019 and at some point in the past a dozen of our prefabs have started changing every time the project is saved even though nobody has touched these assets. The values itself do not seem to change, but the order in which these modifications are saved to disk. This is causing a really big annoyance for us because we are working in a team and team members are constantly confused why these assets show up as changed and cause merge conflicts, when they shouldn't.

    Unity is notorious for setting files dirty even though nothing has changed, this is a well-known problem and other software such as PlasticSCM actually patches some of this up by ignoring files which have their timestamp changed, but not their content. However, in this case with prefabs, the contents change their order which causes a lot of noise in our version control system.

    Again, I believe this is a known bug, but please let me know what the status is, as I cannot find it in the issuetracker. Thank you!
     
    SugoiDev likes this.
  2. mcarriere

    mcarriere

    Joined:
    Sep 14, 2012
    Posts:
    69
    I was just complaining about this / confirming with some other folks! We're seeing this two across multiple 2019 projects. Super annoying. We have hundreds of prefabs in our projects and this can take a long time if you want to be able to verify that no changes were made. When we see this manifest, its just taking the data we have and reordering it in the prefab, no actual changes are being made.
     
  3. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    42
    By chance, do you have auto-save enabled for prefabs?
     
  4. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    483
    No, at least not on my machine. Maybe some of our developers have it on, but the changes already happen when these specific prefabs are loaded into memory (either because a scene was openen which contains them or if they have been selected in the inspector during the editor session), and then the project is saved.
     
  5. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    483
    SpinningDonut.gif
    The problem is getting worse every week. We've now found cases were the affected prefabs are being reimported whenever anything changes in the project and can even become stuck in an import loop. I've reported an issue with reproduction case, but I'm still waiting for a reply. I believe it's rather difficult to reproduce for QA. The issue does not happen when one works on a single user machine, it requires at least two different users/computers to cause the serialization to randomly change. I assume it's mainly because the asset import is not deterministic and therefore, whenever one of my team mates opens their project, Unity imports the prefabs differently, but for unknown reasons this also changes the actual prefab files on disk. To reproduce this, one must setup a multi-user environment with version control. I've explained it in the bug report, so let's see what they say.
     
  6. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    440
    Xarbrough and mcarriere like this.
  7. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    483
    Thanks, that's great news! :) Is there a different issue id I can track or how will we know when the fix has landed?
     
  8. mcarriere

    mcarriere

    Joined:
    Sep 14, 2012
    Posts:
    69
    Thanks for the update @SteenLund! (I'd also love a public issue ID for this one.)