Closed Bug 1892312 Opened 2 months ago Closed 2 months ago

Update times.json with recovery information for the recovered profile

Categories

(Firefox :: Profile Backup, task, P3)

task

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

Details

(Whiteboard: [fidefe-device-migration])

Attachments

(6 files)

The times.json file in a profile directory contains information about profile age - when it was created and first used, for example. This is used by ProfileAge.sys.mjs. We should probably augment this to include restore times as well. Details to be determined, but filing this so that we don't forget about this during this development phase.

So having studied this a bit more, I think what we can do is similar to the reset Promise on ProfileAge, which resolves with the time of the last profile reset if one has ever occurred for the profile (or null if it has never occurred).

https://searchfox.org/mozilla-central/rev/2e7374599f4020d0490ec8c5e877c179c9e153c9/toolkit/modules/ProfileAge.sys.mjs#143-163

I think what we can do is, within MiscDataBackupResource, in the recover method, any time after the times.json file has been copied to the destination profile path, we can use ProfileAge to attach to it like this: https://searchfox.org/mozilla-central/rev/2e7374599f4020d0490ec8c5e877c179c9e153c9/browser/components/migration/FirefoxProfileMigrator.sys.mjs#314-315

we can then call a new method, recordBackupRecovery, which writes a recovery or backupRecovery property to the _times_ internal object of ProfileAge, and then await for it to finish writing.

We'll also then need to add a get backupRecovery() or get recovery() method to ProfileAge to return that property after it has been read in.

I believe we'll want that reported through the same TelemetryEnvironment mechanism that we use for things like firstUseData, etc: https://searchfox.org/mozilla-central/search?q=firstUseDate&path=&case=false&regexp=false

Hey chutten, are we okay to just add a new recovery or backupRecovery property to the profile property of the TelemetryEnvironment current environment? Or is there more to it than that?

Flags: needinfo?(chutten)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #1)

Hey chutten, are we okay to just add a new recovery or backupRecovery property to the profile property of the TelemetryEnvironment current environment? Or is there more to it than that?

You'll need documentation and test and data review to finish off the client responsibilities. And as for the pipeline side alas it isn't Glean so you'll need to update the schema so that it'll make it into columns.

Flags: needinfo?(chutten)

Speaking with nflorez, we want the times.json to actually be copied from the profile that initiates recovery, rather than the profile that the backup was created on (which may or may not be the profile that initiates recovery).

So part of this is also removing support for backing up times.json.

Assignee: nobody → mconley
Attachment #9399896 - Flags: data-review?(chutten)

Comment on attachment 9399896 [details]
Data collection request

DATA COLLECTION REVIEW RESPONSE:

Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?

Yes.

Is there a control mechanism that allows the user to turn the data collection on and off?

Yes. This collection can be controlled through Firefox's Preferences.

If the request is for permanent data collection, is there someone who will monitor the data over time?

Yes, Mike Conley is responsible.

Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Category 2, Interaction.

Is the data collection request for default-on or default-off?

Default on for all channels.

Does the instrumentation include the addition of any new identifiers?

No.

Is the data collection covered by the existing Firefox privacy notice?

Yes.

Does the data collection use a third-party collection tool?

No.


Result: datareview+

Attachment #9399896 - Flags: data-review?(chutten) → data-review+
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8510a0207087
Stop backing up times.json in MiscDataBackupResource. r=backup-reviewers,kpatenio
https://hg.mozilla.org/integration/autoland/rev/197faa33654c
Add recoveredFromBackup measurement to ProfileAge. r=mossop
https://hg.mozilla.org/integration/autoland/rev/3c4d8db39a35
Copy times.json from profile that initiated recovery and record recovery time. r=backup-reviewers,kpatenio
https://hg.mozilla.org/integration/autoland/rev/a471d91079ae
Add recoveredFromBackup to TelemetryEnvironment profile structure. data-review=chutten, r=chutten

Backed out for causing linting opt failures.

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/toolkit/components/telemetry/docs/data/environment.rst:552 | Title underline too short. (rst)
Flags: needinfo?(mconley)
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2eead9e97580
Stop backing up times.json in MiscDataBackupResource. r=backup-reviewers,kpatenio
https://hg.mozilla.org/integration/autoland/rev/20eda867258b
Add recoveredFromBackup measurement to ProfileAge. r=mossop
https://hg.mozilla.org/integration/autoland/rev/fafccbb2fe61
Copy times.json from profile that initiated recovery and record recovery time. r=backup-reviewers,kpatenio
https://hg.mozilla.org/integration/autoland/rev/74119115e500
Add recoveredFromBackup to TelemetryEnvironment profile structure. data-review=chutten, r=chutten

Filed https://github.com/mozilla-services/mozilla-pipeline-schemas/issues/813 to update the legacy telemetry schema in mozilla-pipeline-schemas.

Flags: needinfo?(mconley)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: