Closed Bug 2044665 Opened 5 months ago Closed 1 month ago

Determine what to do on a Firefox Profile Refresh

Categories

(Data Platform and Tools :: Glean: SDK, task, P1)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chutten|PTO, Assigned: chutten|PTO)

References

(Blocks 1 open bug)

Details

(Whiteboard: [2026-dct-workweek])

Attachments

(1 external file)

Firefox, or at least Firefox Desktop, has the concept of a Profile Refresh: same user, same storage, but applied atop an otherwise-freshly-created profile to clear out any cruft that may have accumulated that could cause problems (resetting most settings to default, clearing most caches, etc).

Its behaviuor wrt Legacy Telemetry, profile group, and usage reporting IDs is to store and restore them. It's the same person using the same Firefox within the same context... they've just done some spring cleaning.

In bug 2039807 :Gijs notes that the Glean SDK's profile identifier is not presently stored and restored. It probably ought to be, considering the intent of Refresh and how the other IDs are handled against which the Glean client_id is often compared.

But what else should we do?

This bug is about figuring out what the Glean SDK wants to do in the face of a Refresh, and implementing it. Some ideas already considered:

  • Just the client_id -- we could probably implement this today by cementing client_id.txt's location, portability, and behaviour. And updating the "restoring client_id" docs to mention the Refresh case.
  • All user-lifetime metrics -- the Glean SDK would need some way to export and import them, but if the idea is "this is the same 'user' and the same profile, just cleared out", then this might be more correct. It would also echo the Legacy Telemetry implementation which also stores and restores session-state.json
  • All data -- the point of clearing things out is to fix problems that might arise from garbage. Having a chonky datareporting dir isn't really considered a problem by us, now is it? Maybe we should have Firefox preserve our state entirely, optionally calling a function for the SDK to consider some maintenance tasks?
Priority: -- → P4
Whiteboard: [2026-dct-workweek]

In addition to being what feels like the "correct" behaviour, profile resets contribute meaningfully to new-profile measures and so we should preserve the client identifiers through a reset for data quality reasons, too.

ni?Travis and Jan-Erik

How about Option 1: "just the client_id"? Requires us standardizing on location and some behaviour around client_id.txt, but only as a team-internal "public" interface.

Flags: needinfo?(tlong)
Flags: needinfo?(jrediger)
Assignee: nobody → chutten
Severity: -- → N/A
Status: NEW → ASSIGNED
Priority: P4 → P1

I think I'd like to see the first_run_date preserved and restored along with the client_id. This field is useful in validating client age and is one of the only things we preserve, even across toggling of collection enabled.

Aside from that, the fewer metrics we need to do this the better, and the rest of the user-lifetime metrics we own should fall out into something representative of the post-restore client/profile.

Flags: needinfo?(tlong)

(In reply to Chris H-C :chutten from comment #0)

This bug is about figuring out what the Glean SDK wants to do in the face of a Refresh, and implementing it. Some ideas already considered:

  • Just the client_id -- we could probably implement this today by cementing client_id.txt's location, portability, and behaviour. And updating the "restoring client_id" docs to mention the Refresh case.

Easy to do today. We already rely on it, so it's merely a documentation update that it's now otherwise used.

  • All user-lifetime metrics -- the Glean SDK would need some way to export and import them, but if the idea is "this is the same 'user' and the same profile, just cleared out", then this might be more correct. It would also echo the Legacy Telemetry implementation which also stores and restores session-state.json

New API needed to even expose that.
Not having that data is already a thing we implicitly support anyway (if the database is unreadable or the user deleted it, it's the usual "restore" flow)

  • All data -- the point of clearing things out is to fix problems that might arise from garbage. Having a chonky datareporting dir isn't really considered a problem by us, now is it? Maybe we should have Firefox preserve our state entirely, optionally calling a function for the SDK to consider some maintenance tasks?

With the recent accumulation bugs ... guess we do kinda care. But that's bugs we need to handle anyway.


Overall I'd be fine with option (1) "just the client ID", mostly for easyness of the implementation.

Flags: needinfo?(jrediger)

Docs have been merged, Option 1 it is.

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Blocks: 2082933
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: