diff --git a/browser/components/pioneer/content/pioneer.js b/browser/components/pioneer/content/pioneer.js index 22a67410536f..bc27ddf19fa6 100644 --- a/browser/components/pioneer/content/pioneer.js +++ b/browser/components/pioneer/content/pioneer.js @@ -718,7 +718,7 @@ async function sendDeletionPing(studyAddonId) { // pipeline requires that pings are shaped this way so they are routed to the correct environment. // // At the moment, the public key used here isn't important but we do need to use *something*. - encryptionKeyId: "debug", + encryptionKeyId: "discarded", publicKey: { crv: "P-256", kty: "EC", @@ -727,7 +727,9 @@ async function sendDeletionPing(studyAddonId) { }, schemaName: "deletion-request", schemaVersion: 1, - schemaNamespace: "pioneer-debug", + // The schema namespace needs to be the study addon id, as we + // want to route the ping to the specific study table. + schemaNamespace: studyAddonId, }; const payload = { @@ -748,13 +750,14 @@ async function sendDeletionPing(studyAddonId) { */ async function sendEnrollmentPing(studyAddonId) { let options = { + studyName: "pioneer-meta", addPioneerId: true, useEncryption: true, // NOTE - while we're not actually sending useful data in this payload, the current Pioneer v2 Telemetry // pipeline requires that pings are shaped this way so they are routed to the correct environment. // // At the moment, the public key used here isn't important but we do need to use *something*. - encryptionKeyId: "debug", + encryptionKeyId: "discarded", publicKey: { crv: "P-256", kty: "EC", @@ -774,9 +777,9 @@ async function sendEnrollmentPing(studyAddonId) { // the work on the ingestion pipeline. if (typeof studyAddonId != "undefined") { options.studyName = studyAddonId; - // This is the same namespace used for 'deletion-request' pings. This works because - // the pipeline has a specific exception for it. - options.schemaNamespace = "pioneer-debug"; + // The schema namespace needs to be the study addon id, as we + // want to route the ping to the specific study table. + options.schemaNamespace = studyAddonId; } await TelemetryController.submitExternalPing("pioneer-study", {}, options); diff --git a/browser/components/pioneer/test/browser/browser_pioneer_ui.js b/browser/components/pioneer/test/browser/browser_pioneer_ui.js index 47c760e610f4..e8036804f073 100644 --- a/browser/components/pioneer/test/browser/browser_pioneer_ui.js +++ b/browser/components/pioneer/test/browser/browser_pioneer_ui.js @@ -874,7 +874,7 @@ add_task(async function testEnrollmentPings() { p.schemaName == "pioneer-enrollment" && p.schemaNamespace == "pioneer-meta" && p.pioneerId == pioneerId && - !p.studyName + p.studyName == "pioneer-meta" ), "We expect the Pioneer program consent to be present" ); @@ -883,7 +883,7 @@ add_task(async function testEnrollmentPings() { pingDetails.find( p => p.schemaName == "pioneer-enrollment" && - p.schemaNamespace == "pioneer-debug" && + p.schemaNamespace == CACHED_TEST_ADDON.addon_id && p.pioneerId == pioneerId && p.studyName == CACHED_TEST_ADDON.addon_id ), diff --git a/toolkit/components/telemetry/docs/data/pioneer-study.rst b/toolkit/components/telemetry/docs/data/pioneer-study.rst index d17b339aa92f..d592c692ab44 100644 --- a/toolkit/components/telemetry/docs/data/pioneer-study.rst +++ b/toolkit/components/telemetry/docs/data/pioneer-study.rst @@ -18,8 +18,8 @@ Structure: "encryptedData": "", "schemaVersion": 1, "schemaName": "debug", - "schemaNamespace": "pioneer-debug", - "encryptionKeyId": "debug", + "schemaNamespace": "", + "encryptionKeyId": "", "pioneerId": "", "studyName": "pioneer-v2-example" } @@ -39,7 +39,7 @@ schemaNamespace The namespace used to segregate data on the pipeline. encryptionKeyId - The id of the key used to encrypt the data. + The id of the key used to encrypt the data. If `discarded` is used, then the `encryptedData` will be ignored and not decoded (only possible for `deletion-request` and `pioneer-enrollment` schemas). pioneerId The id of the pioneer client. @@ -55,4 +55,4 @@ This ping has two special Pioneer payload configurations, indicated by the diffe The `deletion-request` is sent when a user opts out from a Pioneer study: it contains the `pioneerId` and the `studyName`. -The `pioneer-enrollment` is sent when a user opts into the Pioneer program: in this case it reports `schemaNamespace: "pioneer-meta"` and will have no `studyName`. It is also sent when enrolling into a study, in which case it reports the same namespace as the `deletion-request` (i.e. `"pioneer-debug"`) and the `pioneer-enrollment` schema name. +The `pioneer-enrollment` is sent when a user opts into the Pioneer program: in this case it reports `schemaNamespace: "pioneer-meta"` and will have no `studyName`. It is also sent when enrolling into a study, in which case it reports the same namespace as the `deletion-request` (i.e. the id the study making the request) and the `pioneer-enrollment` schema name.