Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

when internet resumes bundle is not downloaded 1.1.5?

Discussion in 'Addressables' started by hanniiel, Aug 2, 2019.

  1. hanniiel

    hanniiel

    Joined:
    Jun 14, 2013
    Posts:
    39
    There was a problem when you have no internet and when internet resumes the bundle is not downloaded, till you open the app again. Is this fixed on 1.1.5? There was also a bug with the download progress, is it fixed too?

    Best regards.
     
  2. CharBodman

    CharBodman

    Joined:
    Sep 20, 2018
    Posts:
    36
    As of 1.1.7 the download progress is suppose to be fixed.

    With regards to no internet, the approach that I took is to check for the operation.OperationException

    Code (CSharp):
    1.      
    2. IEnumerator DownloadBundlesAsync()
    3. {
    4.     AsyncOperationHandle operation = Addressables.DownloadDependenciesAsync("foo");
    5.  
    6.     while (!operation.IsDone)
    7.     {
    8.           UpdateDownloadProgress(operation.PercentComplete);
    9.           yield return null;
    10.     }
    11.  
    12.     // Download failed  ( Could be bad internet )
    13.     if (operation.OperationException != null)
    14.     {
    15.          // Here you can prompt the user to retry or do some sort of back off retry approach.
    16.          OnDownloadFailed(operation.OperationException);
    17.     }
    18.  
    19. }
    20.  
    Hope this helps.

    Edit: never mind. Seems there is a bug in re-downloading.
     
    Last edited: Aug 8, 2019
    hanniiel likes this.
  3. hanniiel

    hanniiel

    Joined:
    Jun 14, 2013
    Posts:
    39
    Thank you, it fails every time I re-try to download the bundle till I close re-open app , does this implementation solves it?
    Best regards!
     
  4. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    yup.

    nope.

    but it should be fixed in the next release. The issue is we cache the async operations under the hood, and sometimes could get in a state where a failed op was stuck in the cache.
     
    hanniiel and CharBodman like this.