f-miyu / Plugin.FirebaseStorage

MIT License
12 stars 7 forks source link

CrossFirebaseStorage await forever! #6

Open SamBytess opened 3 years ago

SamBytess commented 3 years ago

Unlike CrossFirebaseAuth & CrossCloudFirestore, All functions in CrossFirebaseStorage will cause your program to await forever when the condition below is true.

  1. Connect to WiFi but with NO Internet connectivity, even though connectivity is still available via mobile data. This is proven to be true when both CrossFirebaseAuth & CrossCloudFirestore manage to sign in and read/write in Cloud Firestore with no problem at all.

Any code using CrossFirebaseStorage function, will appear to be waiting forever, with NO exception caught! for e.g;

        Stream mediaStream = null;
        try
        {
            var reference = CrossFirebaseStorage
               .Current.Instance
               .RootReference
               .Child("ProfilePictures")
               .Child($"{userID}.jpg");

            //var downloadProgress = new Progress<IDownloadState>();
            //downloadProgress.ProgressChanged += (sender, e) =>
            //{
            //    var progress = e.TotalByteCount > 0 ? 100.0 * e.BytesTransferred / e.TotalByteCount : 0;
            //};

            //mediaStream = await reference.GetStreamAsync(downloadProgress);
            mediaStream = await reference.GetStreamAsync();
        }
        catch (Exception e)
        {
            MyAlertDialog.AlertDisplay("GetProfilePic\n" + e.Message);
        }

To the author, please look into this problem as soon as possible. Thank you

f-miyu commented 3 years ago

Sorry, but it is in the specifications. This library depends on Xamarin.Firebase.Storage and it behaves like your description. Thank you