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 download and verify #27

Merged
merged 6 commits into from
Mar 15, 2022
Merged

Fix download and verify #27

merged 6 commits into from
Mar 15, 2022

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Mar 14, 2022

This PR updates the download method to wait until a download is finished before returning and fixes the verify method, which stopped working after the introduction of Axios in #11.

It also adds more test cases to catch bugs like this earlier.

dbanck added 4 commits March 14, 2022 11:40
The default axios responseType is 'json'. In this case we're downloading
a text file (list of shasums) and a binary file (the signature), so
different responeTypes are required.
The download method now waits until all data has been downloaded
and written to the destination file. Before this, the method was resolved
too early, and as a result, subsequent operations ran on an incomplete
download. This caused operations like verify to fail, because of a
different shasum.
@dbanck dbanck marked this pull request as ready for review March 14, 2022 12:02
@dbanck dbanck requested a review from a team March 14, 2022 12:02
@dbanck dbanck self-assigned this Mar 14, 2022
@dbanck dbanck added the bug Something isn't working label Mar 14, 2022
Copy link
Contributor

@jpogran jpogran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@dbanck dbanck merged commit 50fb34f into main Mar 15, 2022
@dbanck dbanck deleted the b-fix-download branch March 15, 2022 12:27
@jpogran jpogran added this to the 1.5.1 milestone Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants