Catalog is updated but Getdownloadsize returns 0

Hey everyone,

Addressable is used to update assets.
If an asset is updated multiple times while the app is running, the first time works fine, but if the catalog is updated a second time, the catalog update is detected, but GetDownloadSizeAsync returns 0.
Subsequent runs of DownloadDependenciesAsync will not download the updated assets.

How do I correctly download updated assets if there are multiple asset updates during application startup?

Can you let us know which version of Unity and Addressables you’re using? When you say the first time works fine, is that the startup catalog check or are those both explicit calls to update the catalog?

I am using Unity 2022.3.20f1 and Addressables 1.21.21.

The flow from initialization to updating the catalog and checking the download size can be briefly written as follows.

var initHandle = Addressables.InitializeAsync(true);
await initHandle;
var checkHandle = Addressables.CheckForCatalogUpdates();
await checkHandle;
if (checkHandle.Status == AsyncOperationStatus.Succeeded && checkHandle.Result.Count > 0){
    var handle0 = Addressables.UpdateCatalogs(true, checkHandle.Results, true);
    await handle0;
    var locationHandle = Addressables.LoadResourceLocationsAsync("all_assets_have_this_tag");
    await locationHandle;
    var locations = locationsHandle.Result;
    var groups = locations.GroupBy(x => x.DependencyHashCode);
    foreach (var location in groups) {
        var list = location.Select(p => p.PrimaryKey);
        var handle1 = Addressables.GetDownloadSizeAsync(list);
        await handle1;
        if (handle1.Status == AsyncOperationStatus.Succeeded) {
            var downloadSize =  handle1.Result;
        }
    }
}

This check is performed at each transition to the title screen.

At the first check after the app is downloaded, the catalog is updated and assets are downloaded correctly.

During gameplay, the server catalog and assets are updated, and when returning to the title, this check is performed and the catalog update is detected, but when attempting to download an asset, GetDownloadSizeAsync returns all zeros.

The resulting asset will not be updated.

However, if the app is then restarted, the catalog is updated and the assets are updated correctly.

I have reproduced the problem and a bug has been opened on this topic. I will update this thread when we have an externally trackable bug.

Hi all. The externally trackable issue is here:

Unity Issue Tracker - CheckForCatalogUpdates() returns 0 even when there is updated content available in the Cloud CDN (unity3d.com)