Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Clarification regarding file upload progress number #95

Open
nik32 opened this issue Sep 14, 2022 · 10 comments
Open

[Question] Clarification regarding file upload progress number #95

nik32 opened this issue Sep 14, 2022 · 10 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@nik32
Copy link
Contributor

nik32 commented Sep 14, 2022

First of all, Great library with to the point docs!!!! Thanks guys!! It really has been of great help!!!

image

@ryanto In the docs it's stated that the progress number will be 'continuously' updated as file's being uploaded.


But when I am uploading a small file (lets say <10mb) - the number doesn't update [it just directly reaches from 0-100]. In case of bigger files, it does update - but that is also in big chunks [like from 0 - 40, to then directly 100. These chunks keep getting smaller as the file size increases, still it seems as if the progress bar is stuck and upload is kind of hung up!!].

Is this the intended behaviour or am I doing something wrong??

@ryanto
Copy link
Owner

ryanto commented Oct 24, 2022

Hi @nik32 sorry I missed this question!

It should update continuously, but I think for smaller files the upload might happen in one part so the only update is 0 to 100.

If you slow your internet down in chrome dev tools (to slow 3g) does it still only update once? it would be worth trying a few scenarios with small files and slow internet to see how the progress is reported.

The AWS SDK has the ability to change part size, so we could allow that to be configured when calling uploadToS3. However, messing with the defaults can sometimes create more headaches so I'd like to avoid that if at all possible.

@ryanto ryanto added the question Further information is requested label Oct 24, 2022
@nik32
Copy link
Contributor Author

nik32 commented Oct 24, 2022

Hi @ryanto, thanks for your replay!!! So I tried for 2 files [one of 900KB and the other of 5.3MB] with slow 3G, and the result was same [it was going directly from 0 to 100]!!

@ryanto
Copy link
Owner

ryanto commented Oct 24, 2022

Ok interesting, that helps! I'll start messing with the part size and see if I can get better progress updates from the aws-sdk. If that goes well I think we can provide some sort of fix/control over how often you get updates.

It might take me a week or two to get started on this.

@nik32
Copy link
Contributor Author

nik32 commented Oct 25, 2022

However, messing with the defaults can sometimes create more headaches so I'd like to avoid that if at all possible.

Thanks @ryanto!!! Do try it, but if it ends up creating more problems at other places, leave it.

@ryanto
Copy link
Owner

ryanto commented Oct 27, 2022

Just looked into this, and the aws-sdk has a minimum part size of 5mb, which unfortunately means that you'll only get progress updates every 5mb.

There's an issue here about using the XHR adapter when doing the upload to get faster feedback: aws/aws-sdk-js-v3#3101

@nik32
Copy link
Contributor Author

nik32 commented Nov 4, 2022

Hi @ryanto!! sorry for the late replay and thank you for your efforts. I went into this aws/aws-sdk-js-v3#3101 and especially this one XHRHttpHandller. So do I need to implement this from our side [i.e. in our project code] or would it be better if you do it inside the library code and provide us some property to opt into it???

Also does this completely replaces fetch as our http request handler [coz in the docs they use the word 'substituted'... as seen in the screenshot below]?? If so is it really worth it to replace for jus upload progress??
image

@ryanto
Copy link
Owner

ryanto commented Nov 7, 2022

Good catch! We'll a way to opt into other adapters (like xhr-http-handler) in this library. It might take me a little while to add that feature, but I think its the best way forward.

@ryanto ryanto added the enhancement New feature or request label Nov 7, 2022
@nik32
Copy link
Contributor Author

nik32 commented Nov 8, 2022

@ryanto thank you for doing this!!! Take your time in doing this, as we are not in a hurry for the next month or so.

@nik32
Copy link
Contributor Author

nik32 commented Nov 8, 2022

@ryanto > Also would opting into xhr-http-handler replace fetch as our http request handler [coz in the docs they use the word 'substituted'... as seen in the screenshot below]?? If so would it really worth it to replace for just upload progress??

image

@chriship
Copy link

chriship commented Oct 10, 2023

@ryanto Just wondering if any progress has been made on this? I'm also noticing my upoads not reporting their progress until fully uploaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants