Ignore keepalive file when restoring backup #318
Merged
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.
Right now
lib/bin/restore.js
quits with the following error message when restoring a backup downloaded from/v1/backup
:This PR modifies the restore process so that it ignores
keepalive
.I had trouble writing a test for this change. Ideally, we would test the result of calling
decryptFromArchive()
on a .zip file that contains both encrypted files and akeepalive
file.encryptToArchive()
returns a .zip files with encrypted files, but I didn't see an easy way to insert akeepalive
file into it. Instead, I verified this change as follows:restore.js
so that it expands the zip into a persistent directory and decrypts encrypted files, but doesn't runpgrestore()
.restore.js
. It did not show the error message and expanded a number of files.lib/bin/backup.js
, uploading a backup to Google Drive.restore.js
on it. I moved the resulting files into the Git repo, comparing to the immediate backup.toc.dat
, a binary file.