supabase-community / storage-csharp

A C# implementation of Supabase's Object Storage API
https://supabase-community.github.io/storage-csharp/api/Supabase.Storage.Client.html
MIT License
19 stars 7 forks source link

Upload progress appears to be 0 or 100 with nothing inbetween #3

Closed Kuffs2205 closed 1 year ago

Kuffs2205 commented 1 year ago

Running the following code:

Private Async Sub test()
    Dim client = Await SupabaseManager.GetInstance.GetClient
    Dim storageBucket = client.Storage.From("testbucket")
    Dim result = Await storageBucket.Upload("c:\test.txt", "test.txt",, AddressOf ProgressStatus)
End Sub
Private Sub ProgressStatus(sender As Object, e As Single)
    Debug.WriteLine($"{Date.Now: dd MMM yyyy HH:mm:ss.fff} : Upload Status = {e}%")
End Sub

Produces the following output.

28 Feb 2023 15:33:36.186 : Upload Status = 0% 28 Feb 2023 15:33:36.186 : Upload Status = 0% 28 Feb 2023 15:33:36.214 : Upload Status = 0% 28 Feb 2023 15:33:36.215 : Upload Status = 0% --snipped many lines -- 28 Feb 2023 15:33:53.998 : Upload Status = 0% 28 Feb 2023 15:33:54.004 : Upload Status = 0% 28 Feb 2023 15:33:54.006 : Upload Status = 0% 28 Feb 2023 15:33:54.010 : Upload Status = 0% 28 Feb 2023 15:33:54.013 : Upload Status = 100%

Possibly it is being cast to an Int at some point in the process?

acupofjose commented 1 year ago

Out of curiosity - could you try it with a larger file and see if it makes a difference?

Kuffs2205 commented 1 year ago

I doubled the size to 40Mb. Same result. Approx 35 seconds to upload and there are approx 10500 status lines output to the debug log. All 0 apart from the last one.

28 Feb 2023 17:01:11.765 : Upload Status = 0% 28 Feb 2023 17:01:11.768 : Upload Status = 0% 28 Feb 2023 17:01:11.770 : Upload Status = 0% Snip 28 Feb 2023 17:01:46.437 : Upload Status = 0% 28 Feb 2023 17:01:46.442 : Upload Status = 0% 28 Feb 2023 17:01:46.444 : Upload Status = 100%

acupofjose commented 1 year ago

Hm. Alright! I’ll take a look. We had to switch to a different HTTP client for broader device/framework support but it meant losing native upload/download progress. So that’s covered by an extension now that apparently has regressed!

Kuffs2205 commented 1 year ago

No problem. Just trying to be helpful by reporting what i find.

This library has been a lifesaver for me.

On Tue, 28 Feb 2023, 17:06 Joseph Schultz, @.***> wrote:

Hm. Alright! I’ll take a look. We had to switch to a different HTTP client for broader device/framework support but it meant losing native upload/download progress. So that’s covered by an extension now that apparently has regressed!

— Reply to this email directly, view it on GitHub https://github.com/supabase-community/storage-csharp/issues/3#issuecomment-1448538816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI7TFOTOHRGQILDBEZ2ZNTWZYV7XANCNFSM6AAAAAAVK4QQRI . You are receiving this because you authored the thread.Message ID: @.***>

acupofjose commented 1 year ago

Available in v1.2.5!