Search Unity

Question Keep getting cached version of Remote Catalog due to .hash file?

Discussion in 'Addressables' started by PJTTG, Jun 4, 2020.

  1. PJTTG

    PJTTG

    Joined:
    Oct 4, 2018
    Posts:
    9
    I've set up a minimal Unity project in which I'm simply trying to test the ability to download updated content via Addressables, after the initial content push.
    • I create a new catalog and set of bundles via Build -> New Build -> Default Build Script
    • I upload the catalog and bundles, and can observe the game successfully downloading and instantiating its assets.
    • I then Update Previous Build, which overwrites my catalog `.json` and `.hash` (and opening them seems to contain the results that I'd expect - updated bundle names and a new hash value in the `.hash`), upload these, and confirm that the changes are on the server
    • I run the project again, but get the old content from the initial build.
    • `ADDRESSABLES_LOG_ALL` tells me that a cached catalog file from my `AppData` directory is being used rather than the one on my server. I can delete the server copy of the catalog, and the old assets continue to be loaded, with no error or indication that it's even trying to acknowledge the server copy.
    • Directly copy-pasting the contents of the updated server version of my catalog file into the cached version loads all of the new updated assets, as "desired".
    The section at the very bottom of this documentation mentions that the `.hash` file plays a role in determining whether to cache the catalog file, or to download it new. When I repeat the above while ensuring that the `.hash` file is never uploaded to the server, I see the correct asset updates every single time (despite the log complaining about its absence).

    I'm guessing this isn't the proper solution. I want to avoid any unnecessary downloading, and would love to benefit from any caching advantages that the Addressables system can offer, but cementing the state of the catalog after its first download obviously runs contrary to the goal of being able to update or release new content.

    Just to get a few potential questions out of the way:
    • When updating, I'm reuploading the asset bundles, the updated catalog `.json` and the updated catalog `.hash`
    • The Asset Group in which I'm expecting to see updates (and do when the correct catalog content is read) is set to `Can Change Post Release`
    • Unity version `2019.2.17f1`; Addressables package `1.9.2`

    What am I doing wrong to make Addressables ignore my updated server catalog when the `.hash` file is present?

    Alternatively, if this is a bug or something (which if it were, it seems pretty crippling), will omitting the `.hash` file only force a reload of the catalog every time, or will I see entire bundles being needlessly reloaded as well?

    Thanks!

    PS. `Please add inline code tags`
     
    phobos2077 likes this.
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    I'll kick this over to the team for them to look into.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    Hmm.. I just tried to reproduce this and wasn't able to using a minimal repro project using the steps you mentioned. I assume this is the case but the asset you're changing is in the Can Change Post Release group and it doesn't have any dependencies in a Cannot Change Post Release group, right?