-
Notifications
You must be signed in to change notification settings - Fork 889
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 js error "The parameter is incorrect" #199
Conversation
Hey @trongrg, thanks for this PR! Can you explain the motivation behind it a bit? When does this happen? What exactly is your code doing to fix it? |
hey @janpio So I have an UWP app using imgcache.js https://github.com/chrisben/imgcache.js to cache the images. imgcache.js use this plugin to download images. When we load a page with 40 images, some of the images are broken, and it jumps to the error handler So this PR check download.progress.bytesReceived, and if it is 0, resolve the error, so no exception is thrown |
What does "download.progress.bytesReceived is 0" mean, in layman terms? |
"download.progress.bytesReceived is 0" means the image is downloaded, but on hard disk its size is 0. This could be the result of a broken transfer. I didn't swallow the exception (it is hard to digest anyway). This exception was thrown by a bug in the code, not intentional. The purpose of that piece of code is to resolve a FILE_NOT_FOUND_ERR, with the downloaded payload. So it try to load the downloaded bytes, however when the bytesReceived is 0, WinJS throws an exception, and break the callback After the change, it still resolves a FILE_NOT_FOUND_ERR, just without a payload in case bytesReceived is 0 |
Ok, way above my pay grade ($0) - let's hope someone who knows a bit about this comes along to merge this. The tests on Travis are failing right now:
and
and
Is this caused by these changes? |
I don't think this PR cause those to fail, because the change is for windows platform, and the tests are failing for android platform |
* upstream/master: (56 commits) remove outdated translations (apache#211) [windows] Fix js error "The parameter is incorrect" (apache#199) also accept android sdk terms for android-27 CB-13826 Incremented plugin version. CB-13826 Updated version and RELEASENOTES.md for release 1.7.1 CB-13749: Add build-tools-26.0.2 to travis Update plugin.xml change dependency version to file >=5.0.0 change dependency version to file 6.0.0 Set VERSION to 1.7.1-dev (via coho) CB-13542 updated file plugin dependency Set VERSION to 1.7.1-dev (via coho) CB-13542 Updated version and RELEASENOTES.md for release 1.7.0 (via coho) Updated links in Deprecation Notice Updated README with Deprecated Status Revert "CB-13294 Remove cordova-plugin-compat" CB-13472: (CI) Fixed Travis Android builds again CB-13294 Remove cordova-plugin-compat CB-13299 (CI) Fix Android builds CB-12809: Google Play Blocker: Unsafe SSL TrustManager Defined ... # Conflicts: # README.md
@janpio Hello. Apologies if this is the wrong place to ask / if this is a bad question. I see the 1.7.1 release was release Jan of 2018, and the 1.7.0 updated the readme with deprecated. I also see there have been merges in to master more recently than Jan of 2018 (specifically this one). Does this plugin being deprecated mean there will no longer be releases? I know I'm able to download this plugin manually, but was hoping to keep this installation using the ionic cordova add method to stay consistent with our process. Thank you so much for any information. |
This is definitely the wrong place, also asking individual committers is not standard. Please create a new issue with your question. |
Platforms affected
windows
What does this PR do?
Fix js error "The parameter is incorrect" when download progress is 0 in error handler
What testing has been done on this change?
Manual testing
Checklist