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

Showing upload progress #378

Closed
olizilla opened this issue Feb 6, 2023 · 2 comments · Fixed by #499
Closed

Showing upload progress #378

olizilla opened this issue Feb 6, 2023 · 2 comments · Fixed by #499
Assignees

Comments

@olizilla
Copy link
Contributor

olizilla commented Feb 6, 2023

We want to show a progress bar to inform the user of what is happening during an upload. At a minimum we want to show how much of the data has been send to w3, e.g.

Screenshot 2023-02-06 at 10 30 01

But there are some hurdles!

Some options

  1. Update upload-client to use XMLHttpRequest where available, which provides a progress event
  2. Update upload-client to use fetch with a ReadableStream as the Request body. We wrap the body in a custom stream that just tracks number of bytes that pass through it, and use this as a proxy for bytes actually sent. This is supported in by about 60% of current browsers, notably Chrome & Edge, but not Firefox or Safari. There are caveats too, e.g. http2 connection required, outlined here

Part of #134

@olizilla olizilla self-assigned this Feb 6, 2023
@olizilla
Copy link
Contributor Author

olizilla commented Feb 6, 2023

aws suggest using xhr to show upload progress in browsers – https://github.com/aws/aws-sdk-js-v3/blob/main/packages/xhr-http-handler/README.md

fetch with a ReadableStream body requires duplex: half to be set – bluesky-social/atproto#470

@heyjay44
Copy link

This will be put on hold. Interim solution can be found in this ticket: storacha/w3up#655

@heyjay44 heyjay44 removed this from the w3up phase 4 milestone Mar 29, 2023
@travis travis linked a pull request Apr 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants