Bug? Bug in FirebaseStorage library

Discussion in 'Bugs & wishlist' started by Ivan Aldaz, Nov 29, 2018.

  1. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    Hi. It's a little typo, but has driven me almost crazy. Here it is:

    When downloading a file with
    Code:
    storage.DownloadFile(FirebaseStoragePath, localDir, "localFile")
    the event sub raised is "storage_DownloadCompleteD", but if you want to "Wait for" the download to finish, you have to write:

    Code:
    Wait for storage_DownloadComplete
    without the 'd' at the end!

    Best regards.
     
    JohnCody likes this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm unable to reproduce it. The code should be:

    Code:
    Wait For Storage_DownloadCompleted (ServerPath As String, Success As Boolean)
    Please upload a small example.
     
  3. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    Attached is the example requested. Note that works in both ways,
    Code:
    Wait For Storage_DownloadComplete (ServerPath As String, Success As Boolean)
    and
    Code:
    Wait For Storage_DownloadComplete
    You can try commenting and uncommenting lines

    EDIT:

    I've noticed that the thread doesn't return to the next line after "Wait For". If so, label1.text should be "Download complete"
     

    Attached Files:

    Last edited: Dec 1, 2018
  4. Erel

    Erel Administrator Staff Member Licensed User

    What is the output of this code:
    Code:
    Sub btnDownload_Click
       
    Private fullPath As String = "/public/TestFile.txt"
       storage.DownloadFile(fullPath, 
    File.DirInternal, "DownloadedTestFile.txt")
       Label1.Text = 
    "  Waiting..."
       
    Wait for storage_DownloadComplete
       
    Log("Wait for storage_DownloadComplete")
    End Sub


    Sub storage_DownloadCompleted (ServerPath As String, Success As Boolean)
       
    Log("storage_DownloadCompleted")
    End Sub
     
  5. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    It goes to the Sub storage_DownloadCompleted, but not to the next line after "WaitFor" ( Log("Wait for storage_DownloadComplete") ):

    Logger connected to: HUAWEI ANE-LX1
    --------- beginning of main
    --------- beginning of system
    Copying updated assets files (1)
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    storage_DownloadCompleted
     
  6. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    With the "d" at the end (Wait for storage_DownloadCompleted), the output is:

    Logger connected to: HUAWEI ANE-LX1
    --------- beginning of system
    --------- beginning of main
    ** Activity (main) Pause, UserClosed = false **
    ** Service (starter) Destroy (ignored)**
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    Wait for storage_DownloadComplete

    ...and the event "storage_DownloadCompleted" is not reached
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Which version of the library are you using?
     
  8. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    FirebaseStorage 1.11
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    I have a feeling that you are actually using an older version. Copy the attached jar to the internal libraries folder. Clean the project and try again.
     

    Attached Files:

  10. Ivan Aldaz

    Ivan Aldaz Member Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    FirebaseStorage is an internal library now. Make sure that you copied the new jar to the internal libraries folder.
     
  12. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    I think it's in the right place:

    upload_2018-12-2_12-34-24.png
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    The date doesn't match the date of the jar I've uploaded in post #9.
     
  14. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    The FirebaseStorage.jar file date seen in post #12 is today's date (02.dec.18), it's the date the file you've uploaded in post #9 has when downloaded.

    Would you mind trying my example in your PC, please? , or could anyone who read this thread try, please?
     
  15. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    Hi again.

    I have been testing Uploading files and getting metadata, and the issue is exactly the same.

    I've been messing around for a long time with this issue and at the end I have deleted the project in Firebase for creating a new one from zero (getting the same result), so the google-services.json file and the bucket name in the .zip file uploaded in post #3 are not valid anymore. I have uploaded a new file, in case someone still wants to try it. I have added code to make it easier to try uploading and getting metadata.
     

    Attached Files:

  16. Erel

    Erel Administrator Staff Member Licensed User

    You've uploaded the wrong google-services.json. Anyway, I'm keeping this issue open for now.
     
  17. Ivan Aldaz

    Ivan Aldaz Member Licensed User

    Sorry for that, and thanks for your efforts and time. Here is the .json file directly downloaded from the Firebase project console right now.
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice