Closed Bug 1892249 Opened 2 months ago Closed 1 month ago

Have BackupService.createBackup use nsIZipWriter to zip up the contents of the staging folder

Categories

(Firefox :: Profile Backup, task, P3)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-device-migration])

Attachments

(1 file)

After the staging folder has been populated, we should write its contents to a ZIP file at maximum compression. We can place this ZIP file either within the staging folder (it will only be there temporarily).

Because there may be several ways that the BackupService might emit the output from a backup (and they might not be mutually exclusive!), what I recommend is that we try to decouple this action from the BackupService a bit.

We should perhaps have a BackupArchive abstract class that has a single write method, which takes a single stagingPath string parameter and returns a Promise when the archiving activity has been completed.

Similar to BackupResource, we can then iterate through every BackupArchive that's been registered and call write on each, passing in the staging path.

We can then have a SingleFileBackupArchive subclass of BackupArchive, which will do the work of writing the ZIP file.

Severity: -- → N/A
Priority: -- → P3

This is an intermediary stage before the compressed archive gets (optionally)
encrypted and written into the container file. This is why there's not a whole
lot of testing for the compressed file - those tests will get added once it
completes its journey into the container file so that we can test both
extraction and decompression at the same time.

Assignee: nobody → mconley
Status: NEW → ASSIGNED
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6e2699724abd
Use nsIZipWriter to compress the staging folder. r=backup-reviewers,fchasen

Backed out for causing marionette failures in PathUtils.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: Assertion failure: !aPath.Contains(u'/') (Windows paths cannot include forward slashes), at /builds/worker/checkouts/gecko/dom/system/PathUtils.cpp:341
    PROCESS-CRASH | MOZ_RELEASE_ASSERT(!aPath.Contains(u'/')) (Windows paths cannot include forward slashes) [@ mozilla::dom::PathUtils::SplitRelative] | browser/components/backup/tests/marionette/test_backup.py BackupTest.test_backup
Flags: needinfo?(mconley)
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9c4c1bfdbe5a
Use nsIZipWriter to compress the staging folder. r=backup-reviewers,fchasen
Flags: needinfo?(mconley)
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: