-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use XHR
instead of fetch
to provide progress updates
#52
Comments
This would imply swapping following code path: Lines 147 to 151 in 61c7fe2
with something along the lines of |
As per #52 this adds `onUploadProgress` / `onDownloadProgress` optional handlers. Intention is to allow ipfs-webui to render file upload progress when new content is added. Fixes #52 Co-authored-by: Alex Potsides <[email protected]>
Reopening this issue as it had to be reverted #58, as it broke pub / sub. |
Moving some of the conversation from #54 here From @achingbrain
Sorry for the complications, I was not aware of this.
That is how we used to do that back in pre-fetch days. However since I imagine on pubsub response body to be unbound, it's probably not going to be viable option.
From the sound of it, we only care about streaming body on pubsub, in all other cases getting body via XHR seems reasonable. Therefor instead of trying to workaround XHR, we could probably have an option to choose between progress events and streaming response. That way pubsub can continue using fetch and file upload can opt-in into XHR via progress events. Added complexity is unfortunate, but I don't think there is anything better we can until |
@achingbrain what do you think about using |
fetch
API does not provide an API to monitor upload progress which prevents ipfs-webui from reporting any progress on file add.There are some discussions around making progress observable:
It appears that ReadableStreams will at some point provide a way to do that, however no browser supports it today.
In the meantime I'd like to propose using XHR & it's progress events.
The text was updated successfully, but these errors were encountered: