Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduced Changes
#746 prevents uploading broken or truncated images. In my experience, the most common source of broken images or sdk files are interrupted downloads.
This PR should prevent most issues arising from interrupted downloads by using different filenames as download target and for checking whether the file has been downloaded already.
After the download finishes, the temporary file is moved into the correct place atomically, preventing half-finished files from ending up in the final location.
Fixes #
ToDo / Known Issues
Ideas for Next Iterations (Not This PR)
How to Test
Use with either
pepsi gammaray
orpepsi sdk install
and abort during download. Then run the same command again and observe the result.On main, gammaray would try to upload the truncated image file to the nao (careful, this can leave the robot in a broken state, improved by #746) and sdk installation would complain about broken file permissions, which isn't exactly helpful unless you already know what the issue is.
With this PR, the download should be simply reattempted upon running the command a second time.