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

fix: Upload attachment progress #107

Merged

Conversation

petersalomonsen
Copy link
Contributor

File upload is now adjusted to use the progress events from HttpClient in @angular/common/http.

Also the progress events don't fire when using a serviceworker, so commit 16b4b9d is about bypassing the service worker for the file upload URL.

The problem is mentioned in the following Angular issues:

angular/angular#21191
angular/angular#24683

Hopefully just letting the fetch event handler return instead of calling event.respondWith() could be supported for selected patterns/URLs in future Angular versions. See the exact patch of ngsw-worker.js here:

// Bypass serviceworker when uploading files so that we can get upload progress

(currently this file is just copied into the dist folder after build so it needs to be updated if there are new versions of @angular/service-worker)

support for HttpClient from @angular/common/http
so that we can get upload progress events
@petersalomonsen petersalomonsen merged commit c759d89 into runbox:master Apr 2, 2019
@petersalomonsen petersalomonsen deleted the upload-attachment-progress branch April 2, 2019 11:35
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 this pull request may close these issues.

1 participant