Closed
Bug 1885372
Opened 8 months ago
Closed 8 months ago
Implement a basic `createBackup` method on BackupService
Categories
(Firefox :: Profile Backup, task, P1)
Firefox
Profile Backup
Tracking
()
RESOLVED
FIXED
126 Branch
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
Details
(Whiteboard: [fidefe-device-migration] )
Attachments
(1 file)
For now, this can be fairly simple. The steps are roughly as follows:
- We will add a
backup
method to the abstractBackupResource
class defined as such:
/**
* @typedef {Object} ManifestEntry
* A ManifestEntry is created by a BackupResource to describe the items
* that have been backed up. The ManifestEntry is then serialized and written
* to the backup manifest.
*/
/**
* Perform a safe copy of the resource(s) and write them into the backup
* database.
*
* @param {string} stagingPath
* The path to the staging folder where copies of the datastores for this
* BackupResource should be written to.
* @param {string} [profilePath=null]
* This is null if the backup is being run on the currently running user
* profile. If, however, the backup is being run on a different user profile
* (for example, it's being run from a BackgroundTask on a user profile that
* just shut down, or during test), then this is a string set to that user
* profile path.
*
* @returns {Promise<ManifestEntry>}
*/
// eslint-disable-next-line no-unused-vars
async backup(stagingPath, profilePath = null) {
throw new Error("BackupResource::backup must be overridden");
}
It is not expected that in this bug that backup
should be implemented for each existing BackupResource subclass. That can come later.
- Add a new method
createBackup
on BackupService. - Have
createBackup
check to see if abackups
folder exists in the user profile directory. If not, create it. - Check to see if a
staging
folder exists in thebackups
folder. If so, delete it. - Create an empty
staging
folder in thebackups
folder. - For each BackupResource, create a new directory under
staging
with thekey
from the resource class. - Call
backup
on each BackupResource, passing the path to the staging folder. Wrap this in a try/catch, and log any errors.
It is expected that calling createBackup
should log an error for each BackupResource, since none of them will initially implement backup
.
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee: nobody → mconley
Assignee | ||
Comment 1•8 months ago
|
||
Assignee | ||
Updated•8 months ago
|
Priority: P3 → P1
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bc7ca80e302a
Create a basic createBackup method on BackupService. r=backup-reviewers,fchasen
Comment 4•8 months ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 months ago
status-firefox126:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•