commit 1a3fabb47096daa440ff459664552c18b3384f53
parent e7b2c020a547e2f87378b53f805862f2826e2d89
Author: Mark Hammond <mhammond@skippinet.com.au>
Date: Tue, 9 Dec 2025 23:06:23 +0000
Bug 1998846 - fix typo in sync ping reason declared for glean. r=skhamis,sync-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D275556
Diffstat:
3 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/services/sync/modules/metrics.yaml b/services/sync/modules/metrics.yaml
@@ -852,7 +852,7 @@ syncs:
type: string
description: |
Hashed FxA unique ID, or string of 32 zeroes.
- If this changes between syncs, the "sync" ping is submitted with reason "idchanged".
+ If this changes between syncs, the "sync" ping is submitted with reason "idchange".
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1963812
data_reviews:
@@ -870,7 +870,7 @@ syncs:
description: |
Hashed FxA device ID, hex string of 64 characters.
Not included if the user is not logged in.
- If this changes between syncs, the "sync" ping is submitted with reason "idchanged".
+ If this changes between syncs, the "sync" ping is submitted with reason "idchange".
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1963812
data_reviews:
diff --git a/services/sync/pings.yaml b/services/sync/pings.yaml
@@ -21,9 +21,9 @@ sync:
Ping submitted due to app shutdown.
schedule: |
12h have elapsed since the previous ping.
- idchanged: |
+ idchange: |
The ID of the user or device has changed.
- Probably means a different user has logged in.
+ Probably means a user signed out, or a different user has logged in.
include_client_id: false
send_if_empty: false
bugs:
diff --git a/services/sync/tests/unit/test_glean.js b/services/sync/tests/unit/test_glean.js
@@ -1251,6 +1251,56 @@ add_task(async function test_node_type_change() {
await promiseStopServer(server);
});
+add_task(async function test_uid_change() {
+ enableValidationPrefs();
+
+ await Service.engineManager.register(BogusEngine);
+ let engine = Service.engineManager.get("bogus");
+ engine.enabled = true;
+ let server = await serverForFoo(engine);
+
+ await SyncTestingInfrastructure(server);
+ let telem = get_sync_test_telemetry();
+ telem.maxPayloadCount = 500;
+ telem.submissionInterval = Infinity;
+
+ // a sync with the "old" uid.
+ await Service.sync();
+
+ fxAccounts.telemetry._setHashedUID("deadbeef");
+
+ try {
+ await GleanPings.sync.testSubmission(
+ reason => {
+ equal(reason, "idchange");
+ equal(
+ Glean.syncs.syncs.testGetValue().length,
+ 1,
+ "first sync in its own ping"
+ );
+ },
+ async () => {
+ await Service.sync();
+ }
+ );
+ await GleanPings.sync.testSubmission(
+ () => {
+ equal(
+ Glean.syncs.syncs.testGetValue().length,
+ 1,
+ "second sync in its own ping"
+ );
+ },
+ async () => {
+ telem.finish();
+ }
+ );
+ } finally {
+ await cleanAndGo(engine, server);
+ await Service.engineManager.unregister(engine);
+ }
+});
+
add_task(async function test_deletion_request_ping() {
async function assertRecordedSyncDeviceID(expected) {
// `onAccountInitOrChange` sets the id asynchronously, so wait a tick.