Search Unity

Feedback Unity Hub Ignores Project Version

Discussion in 'Unity Hub' started by Nyarlathothep, May 29, 2019.

  1. Nyarlathothep

    Nyarlathothep

    Joined:
    Jun 13, 2013
    Posts:
    398
    We have a Unity project which has several versions of the project in different branches in git. Some of these branches are using different editor versions.

    With the older Unity hub this was fine, each version of the project has the correct editor version stored in ProjectSettings/ProjectVersion.txt and the launcher would launch the correct version for whatever branch we're on.

    With Unity hub 2.0 the hub itself now seems to store the editor version for a project. For example let's say I launch the project in 2018.4, then close it and change to the 2019.1 branch. I will see this:

    Unity_Hub_2019-05-29_16-52-25.png

    The hub has remembered that this is a 2018.4 project even though ProjectVersion.txt specifies Unity 2019.1. When I try to open this project it will ask me if I want to "upgrade", which is obviously completely wrong. It's even worse the other way around where it asks if I want to downgrade!

    Is there a reason the Unity Version field in Hub isn't simply reflecting the contents of ProjectSettings/ProjectVersion.txt and is there a workaround for this behaviour?
     
    Reverbing likes this.
  2. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334
    Hi Nyarlathotep,

    First of all, thank you for your feedback.
    What you are experiencing is not intended behavior and I need to see why it is happening.
    However, to answer your question about the ProjectVersion.txt, the problem is that the editor is updating that file when the project is successfully upgraded/downgraded/loaded.
    Currently, we don't have a channel to notify the hub about this change, which means hub needs to poll this file (and all other projects) for the changes in this file (which can be I/O heavy)
    What we did, and I need to see why it is not working in v2.0, was to assume the upgrade is successful, and update the project version in the list. If the upgrade is failing, we will read the file later, and revert our assumption.

    Ideally, we can ask the editor to notify the hub, but until then (and while we are supporting older editor versions), we need to use the current solution.

    To sum up, from the user perspective, this is a bug, and it would be great if you can report it as a bug in the hub bug reporter for tracking purposes. Meanwhile, I will ask the team to see if we can reproduce the issue.

    Thanks again,
    Afshin
     
    Nyarlathothep likes this.
  3. Nyarlathothep

    Nyarlathothep

    Joined:
    Jun 13, 2013
    Posts:
    398
    I'm glad to hear that's not the intended behaviour!

    For reproducing I'd just say try:
    1. Create git repo
    2. Create Unity 2017.4 project
    3. Switch branches
    4. Create Unity 2019.1 project
    5. Switch back and forth between branches, closing and launching Unity between
    Note that this process should never run any upgrade or downgrade, these are totally isolated projects on different versions living in different branches. From what you said it sounds like the lack of an upgrade may be an important factor here?

    I just did a little more testing and this doesn't seem to happen every time I switch branches between project versions, and I can't quite pin down a specific set of actions to trigger it. Now that I know it's considered a bug I'll try to keep a closer eye on things to see if I can work out a reliable reproduction.
     
  4. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334

    As I explained, in other tools like IDEs or Github Desktop, the application in monitoring a single folder for changes, while in the hub, we need to check multiple projects periodically to identify the changes (which results in high I/O)

    We are investigating to see if the OS can notify the hub about these changes or change the UX to let the user refresh the projects on demand.

    That said, the issue of git branching is under our radar and we are open to suggestions as well.

    Best,
    Afshin
     
    Nyarlathothep likes this.
  5. Nyarlathothep

    Nyarlathothep

    Joined:
    Jun 13, 2013
    Posts:
    398
    That makes sense.

    > we are open to suggestions as well.

    How about an extra option to the "Unity Version" dropdown which controls how the project is opened to just have "Automatic" as an option which reads the ProjectVersion.txt when the project is opened and uses whatever version is specified. That way the hub doesn't need to be trying to monitor hundreds of folders for changes.

    Alternatively if you try to launch a project in a different version of Unity than what the ProjectVersion.txt file specifies it currently shows a window asking if you want to upgrade. You could just add another button to that window, so your options are:
    • Upgrade
    • Cancel
    • Open in <Unity version specified in file> instead
     
    afshinity likes this.