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
plugins: manual_download: Resolve copyFile promise #1786
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1786 +/- ##
=======================================
Coverage 57.62% 57.62%
=======================================
Files 26 26
Lines 800 800
=======================================
Hits 461 461
Misses 339 339
Continue to review full report at Codecov.
|
Pushed the lint fix in a separate commit |
The whole block beginning with `.then(downloadedFilePath` and ending with `copyFile()` did not return anything and was never going to resolve its promise with an actual return value. That meant that that `checkFile()` was being called before any of the promise functions inside the previous block had the chance to run, therefore the copied file was not yet available, leading to checkFile trying to verify a non-existent path, leading to a checksum mismatch error. Solution is to make the whole block return something, in this case the value of the last chained promise, by removing the curly braces. Solves: ``` error: Error: core:manual_download: Error: checksum mismatch ``` Fixes #1754
Generated by `npm run lint-fix`
@NeoTheThird @UniversalSuperBox mind taking a look at this? |
Since Jan seems MIA currently, @Flohack74 would you like to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, sorry for the delay and thanks for the contribution
Hey, you're under no obligation here. Thanks for writing this installer in the first place! |
The whole block beginning with
.then(downloadedFilePath
and ending withcopyFile()
(^1) was never going to resolve its promise with an actual return value.That meant that that
checkFile()
was being called before any of the promise functions inside the previous block hadthe chance to run, therefore the copied file was not yet available, leading to checkFile trying to verify a non-existent path, leading to a checksum mismatch error.
Solution is to make the whole block return something, in this case the value of the last chained promise.
Solves:
Fixes #1754
^1:
ubports-installer/src/core/plugins/core/plugin.js
Lines 205 to 219 in 95745e5