Skip to content

Commit bcec4fa

Browse files
committed
Bug 1893015 - Fix an issue where experimentation-id wasn't making it into certain pings.
1 parent 3e5e70e commit bcec4fa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

glean/src/core/pings/maker.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,14 @@ export function collectPing(ping: CommonPingData, reason?: string): PingPayload
254254

255255
// Insert the experimentation id if the metrics aren't empty
256256
if (ping.includeClientId && Context.config.experimentationId) {
257-
if (metricsData != undefined) {
258-
metricsData["string"]["glean.client.annotation.experimentation_id"] = Context.config.experimentationId;
257+
if (metricsData !== undefined) {
258+
metricsData = {
259+
...metricsData,
260+
string: {
261+
...metricsData?.string || undefined,
262+
"glean.client.annotation.experimentation_id": Context.config.experimentationId
263+
}
264+
}
259265
} else {
260266
metricsData = {
261267
"string": {

0 commit comments

Comments
 (0)