-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Upload progress incorrect in Google Chrome #1016
Upload progress incorrect in Google Chrome #1016
Conversation
@mkszepp would it be possible to add some tests for checking progress values? We could then run those tests in both Chrome and Firefox to catch regressions here. |
I'm not sure if we can test the difference at this level. If I understand correctly, both Chrome and Firefox may have a wrong file size in ember-file-upload/ember-file-upload/src/mirage/upload-handler.ts Lines 55 to 61 in c3af01e
|
I had a look in specification: https://xhr.spec.whatwg.org/#the-send()-method If I understand correctly, the |
@jelhan exact, we have specially on Chrome the behavior, that I have tested this fix today with a 30 MB image in "Fast 3G" mode and it works. Edit: |
@mkszepp great, thanks! Please keep me posted on writing tests. I do think we should probably merge this either way, but would love to have regression coverage. |
Thank you @mkszepp – this looks like an improvement. I'll try to stand up tests
Yes, that's why I am requesting (in #1013) that we record some upload event data from different browsers and endpoints so that we can re-arrange some internals and replay those events in unit/integration tests Testing this with the existing mirage handler is useless because the browser and endpoint behaviour is mocked |
Pretty sure I've validated with unit tests that this fix is correct – at least for this specific issue (progress straight to 100% in Google Chrome). I'll open a proof PR shortly |
Skips the browser, http, network etc. and lets us test the smallest unit of our internals – an UploadFile having its state updated by a series of ProgressEvent events. For each scenario I'm pretty sure we only need to test a single file with a stream of synchronous events. Covers some recorded events from different browsers and endpoints. We can add more scenarios here if we come across them. Specifically, the Chrome scenario proves the fix in #1016 – this was previously failing early with 100% progress, which is the same issue reported by users in #1013 I've painstakingly copied values from log screenshots to setup this existing suite. Hopefully contributors can PR full tests in future to make things a bit easier 😅 Fixes #1013
Thanks again. Fix released in 8.3.1 |
Thanks! i have tested in my app and works! @RobbieTheWagner maybe you can give us also a short feedback, if the bug in you app is also resolved with this fix. |
Sometimes the browser doesn't has the correct file size
onloadstart
. like described here: #1002 (comment)During debugging i have found out, that this bug is present in Chrome. In Chrome there is often a total wrong
total
size (see comment) and in Firefox there is sometime a little difference between the total sizeonloadstart
andonprogress
.We should set
file.size
like in earlier versions also inonprogress
event and check inprogress
event, if the upload is already complete.#1013
Progress log on Chrome with this fix (3 files in queue):
Progress log in Firefox after fix (3 files in queue):