GetDownloadSize does not complete when server not available

I have the following code in a coroutine used to regularly check if any Addressable updates are available.

var catalogOperation = UnityEngine.AddressableAssets.Addressables.CheckForCatalogUpdates( false );
while ( !catalogOperation.IsDone )
    yield return null;
if ( catalogOperation.Status == AsyncOperationStatus.Succeeded && catalogOperation.Result.Count > 0 ) {
    UpdateLog( "Catalog Update Available" );
    catalogUpdateAvailable = true;
}
else if ( catalogOperation.Status == AsyncOperationStatus.Succeeded ) {
    UpdateLog( "No Catalog Update Available" );
}
else if ( catalogOperation.Status == AsyncOperationStatus.Failed )
    UpdateLog( "Could not check for catalog updates" );
UnityEngine.AddressableAssets.Addressables.Release( catalogOperation );

AsyncOperationHandle<long> contentOperation = UnityEngine.AddressableAssets.Addressables.GetDownloadSizeAsync( "global" );
contentOperation.Completed += ( ao ) => { Debug.Log( "Completed" ); };
while ( !contentOperation.IsDone ) {
    Debug.Log( $"Content check {contentOperation.PercentComplete * 100}% complete with status {contentOperation.Status}" );
    yield return null;
}

I am first checking for catalog updates and then using GetDownloadSize to check for missing content that needs to be downloaded (especially useful for a first time install). When the server is available this code works without any problems. However, if I disable the hosting service, the contentOperation never finishes. The Completed event never fires and IsDone never returns true. However percent complete will correctly be 1.

I believe this is a bug as in theory GetDownloadSize should complete and return 0 if it can’t reach the server and find anything to download.

Edit: Sorry this code will not work if there is nothing new to download whether or not the server is available. It works on the first run, downloads all the content, and then on the next launch it will hang.

I’ll flag this for the team to have a look. If you haven’t yet, could you also file a bug report for us? Unity QA: Building quality with passion

@TreyK-47 will try to file a bug report when I get a chance. In the meantime I did some debugging and it appears it is connected to the Addressables m_InitializationOperation.Task status always being stuck on WaitingToRun. However I cannot figure out why that happens and why it only happens after all the content has been downloaded the first time.

Update: I believe this issue is the same as described here: [BUG] CacheInitialization deadlocks and prevents Addressables initialization

Thanks! Connected with the team, and they also advised that filing a bug report is the best course to take.