Closed Bug 1952316 Opened 6 months ago Closed 3 months ago

Centralize context_id reading mechanism into a module, and add the ability to rotate the context_id after some number of days

Categories

(Firefox :: New Tab Page, task, P3)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files, 3 obsolete files)

We have a number of places where we read the context ID preference:

https://searchfox.org/mozilla-central/search?q=.contextId%22&path=&case=false&regexp=false

It's quite repetitive, and we can probably centralize this a bit. Similarly, I've been talking to efixler from the ads team, and we want to try rotating the context_id every 30 days. Rotating the context_id was, apparently, always the plan, but until now nobody's filed a bug to do it. So I'm hoping this can be a two-fer.

I'm also planning on making the rotation window instrumentable from Nimbus so that we can shrink it further from 30 days, if we decide we'd like to do that down the road.

Assignee: nobody → mconley
Attachment #9471435 - Attachment description: WIP: Bug 1952316 - Add a module for generating, caching and rotating the context id. r?nanj! → Bug 1952316 - Add a module for generating, caching and rotating the context id. r?nanj!
Status: NEW → ASSIGNED

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D241480 Bug 1952316 - Have Search / URL bar code use the ContextID module for accessing the current context_id. r?adw!,Dexter! mconley adw: Back May 12, 2025

:mconley, could you please find another reviewer?

For more information, please visit BugBot documentation.

Flags: needinfo?(mconley)

I'm re-implementing this work as a shared Rust component in application-services, and will use this bug to vendor that component in and wrap the Uniffi-generated JS with something a little more ergonomic.

Flags: needinfo?(mconley)
Attachment #9471435 - Attachment is obsolete: true
Attachment #9471838 - Attachment is obsolete: true
Attachment #9471839 - Attachment is obsolete: true

Okay, I think I'm finally ready for review here. The end goal with this stack of patches is, by default, that the actual behaviour of what gets sent for Glean ingestion / MARS does not change with the default prefs here - but then we rotation is enabled (which requires both enabling the Rust backend, and having the rotationDays value be greater than 0), that sending the context ID to MARS and Glean for deletion is delegated entirely to the ContextId.sys.mjs module.

I realize there's additional work required here for the ETL job for the context-id-deletion-request ping.

Attachment #9487133 - Attachment description: Bug 1952316 - Create ContextId module to wrap RustContextId.sys.mjs. r?nanj!,markh! → Bug 1952316 - Create ContextId module to wrap RustContextId.sys.mjs. r?nanj!,markh!,chutten!
Blocks: 1966739
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bf2511b7937a Vendor in context_id component from application-services. r=markh https://hg.mozilla.org/integration/autoland/rev/2861c19f2109 Create ContextId module to wrap RustContextId.sys.mjs. r=nanj,markh,chutten https://hg.mozilla.org/integration/autoland/rev/d9de52a3711b Have New Tab code use the ContextId module for accessing the current context_id. r=home-newtab-reviewers,maxx https://hg.mozilla.org/integration/autoland/rev/955c37619ae6 Have Search / URL bar code use the ContextID module for accessing the current context_id. r=adw,search-reviewers,urlbar-reviewers,scunnane
Blocks: 1967503
Blocks: 1967529
Blocks: 1967505
QA Whiteboard: [qa-triage-done-c141/b140]
See Also: → 1970970
Blocks: 1971764
Blocks: 1981851
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: