Search Unity

Bug ClearDependencyCacheAsync appears to do nothing

Discussion in 'Addressables' started by inkletom, Jul 18, 2020.

  1. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    63
    Addressables.DownloadDependenciesAsync loads assets from a key, which are visibly downloaded to C:\Users\USERNAME\AppData\LocalLow\Unity, taking a few seconds to complete. Running it again completes immediately.
    Addressables.ClearDependencyCacheAsync with the same key appears to do nothing at all. Files still exist in the cache folder. Downloading again completes immediately, suggesting that it's still cached.
    Caching.ClearCache() does work, clearing the cache folder and making the download call take a few seconds to complete, but clears the entire cache so isn't a great solution.

    Tested in editor.

    Anyone else seeing this?
     
  2. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    63
  3. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    392
    Still doesn't seem fixed

    in 1.16.1 it throws a "Exception: Attempting to use an invalid operation handle"
     
  4. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    63
    Yeah :( I'd really, really appreciate some indication from someone on the Unity team about this. Is anyone able to comment?
     
  5. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    I'll flag this for the team to share their insight.
     
  6. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    After circulating with the team, it was suggested that you update to a new version of Addressables - please let us know if the problem persists after doing so.
     
  7. booferei

    booferei

    Joined:
    Sep 29, 2016
    Posts:
    21
    I'm still seeing this error: "Exception: Attempting to use an invalid operation handle"
    I've upgraded to Addressables v1.16.15.
    Admittedly I'm stuck with an old version of Unity, 2018.4.29.
     
  8. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Hmm...let me check with the team for some guidance.
     
  9. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    So, for the throwing the invalid handle exception, I just did a little test and I see that. There's a workaround you should be able to use where you use the version of the API that returns an operation handle and pass in false to "autoReleaseHandle". Then you can yield return on the handle and release it yourself after it completes. This, of course, isn't ideal.

    If that workaround works for you I'd be curious to know if you're still seeing issues with the files not getting cleared. That's what we thought we cleared but obviously missed these other cases. I'll have to check our test suite regarding this API. It sounds like there are some pretty egregious holes in our tests.

    If the files still also aren't getting cleared then that's really not good. I'm throwing in a ticket for the invalid handle thing but I'll update it on our end if the files aren't clearing correctly.

    Terribly sorry about the delay in attention to this and the inconvenience this has caused.
     
  10. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    Just wanted to update: this should be fixed in the upcoming release (1.17.6-preview+)
     
    Caydo and tokar_dev like this.