-
-
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
Correct loaded
& progress
values when file is uploaded
#1002
Conversation
Hey @mkszepp thanks for your contribution. I'm sure it's at least more correct than what we have at present 😅 Just one thing... it would be really nice to add some test coverage for this logic. I will grant that this area is not well tested, and maybe a little complicated to cover given the objects involved. Anyway, I'll see if I can stand up some tests myself soon but feel free to add your own here |
loaded
& progress
values when file is uploadloaded
& progress
values when file is uploaded
Hey 👋🏻 @mkszepp It was more difficult than I thought but I have managed to (I think) reproduce part of this issue through a regression test in #1005 I've already validated that your changes in this PR fix the issue expressed in that test. Could you please 👀 review that and let me know your thoughts 🙇🏻 |
Hi @gilest sry, i haven't got time to write tests in the last days. thank you ❤️ for your PR, it looks good! Also the notes are perfect and clearly. 😀. I think its ready for release... after the release, i will try it in my app. |
Thanks for your review 😄 I'm happy to merge this bugfix now. Could you please:
|
# Conflicts: # ember-file-upload/src/system/http-request.ts
Thank you @gilest! now i have fixed merge confliects und activated tests. |
Released in 8.2.1. Thanks again for your contribution |
@gilest thank! I have updated the package in my app and this is now the result of the progress bar (there are 3 files in queue, which will be uploaded sequential). It looks better than before, but i think there is something, not to 100% correct... (i'm not sure if there is now a my code part or something of It looks like, when the a file upload is completed, the percentage are not correct... but i will debug it
|
now i have debugged and found out, why this occures... When the upload is completed, To fix this behavier we should replace the PR for this fix: #1007 |
@mkszepp after this PR, it seems all our file uploads just go straight to 100% progress. Every version before 8.2.1, which this was in, worked correctly. Any thoughts on how we can fix things? |
@RobbieTheWagner i have also seen the issue from @gilest (#1013) I have updated the addon some days ago in my app and tested with firefox and it looks perfect (no up/down jumping of progress bar like before)... I have now tested the upload again in Chrome and i think that the browser behavier is different... it looks like in Firefox works correctly but on Chrome it looks buggy 😢 I will try to debug it deeper to make a PR to fix this behavier... sry for this incident Progress bar in chrome while uploading 3 files:
Progress bar in Firefox while uploading 3 files:
|
added a new PR that shoud fix the bug in Chrome and that works also in Firefox (#1016) |
@mkszepp thanks for looking into this! Have you tried with just one really large file? When I do one really large file on Chrome and set my Network to "Slow 3G" in devtools so that I can better see the progress, it's just always 100%. Perhaps your changes fix that, but I just want to make sure. |
@RobbieTheWagner yes i have tested with a 30MB image in "Fast 3G" on Chrome & Firefox (the upload needs in this case more than 5 mins). Also all previous tests were done in Fast 3G mode |
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 size onloadstart and onprogress. We should set file.size like in earlier versions also in onprogress event and check in progress event, if the upload is already complete.
fix #1001