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

Notify about progress when uploading / downloading files #145

Open
2 of 3 tasks
goloroden opened this issue Mar 16, 2019 · 1 comment
Open
2 of 3 tasks

Notify about progress when uploading / downloading files #145

goloroden opened this issue Mar 16, 2019 · 1 comment
Labels

Comments

@goloroden
Copy link
Member

goloroden commented Mar 16, 2019

What is this feature about?

Right now, when uploading or downloading a large file to or from file storage, you just have to wait. It would be great if there was an option to get notified about the progress being made. We already have figured out an API for this:

client.on(`progress::${id}`, ({ type, progress, elapsedTime, estimatedRemainingTime }) => {
  // type: 'upload', 'download'
  // progress: 0..100 (in %, not rounded)
  // elapsedTime: 0..x (in milliseconds)
  // estimatedRemainingTime: 0..x (in milliseconds)
});

Internally, once progress 100 has been reached, all event listeners for the appropriate ID should automatically be removed.

Additionally, you can provide an onProgress callback to the addFile and getFile calls.

What needs to be done to implement this feature?

  • Implement the new API in the wolkenkit-depot-client-js module
  • Add tests
  • Update documentation

What else should we know?

This issue was brought up by @SteffenGottschalk, so we should notify him once this has been done.

@goloroden
Copy link
Member Author

goloroden commented Mar 20, 2019

Unfortunately, axios calls the onUploadProgess and onDownloadProgress events in a very unreliable way (which is probably caused by the underlying implementation of the browsers):

  • In Node.js, the events are not supported at all.
  • In Chrome (macOS and Windows) the events also never happen.

I didn't test Firefox, but if it doesn't work in Chrome, I think it's questionable whether it makes sense to implement this. I also tested this with a large file (of almost 2 gb in size), but again, no events happened.

Hence, I am going to close this issue, we won't implement this.

@goloroden goloroden reopened this Mar 26, 2019
goloroden added a commit to thenativeweb/wolkenkit-depot-client-js that referenced this issue Mar 26, 2019
@goloroden goloroden removed their assignment Sep 10, 2019
@goloroden goloroden removed this from the wolkenkit 4.0: Next generation milestone Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant