Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Fix to retrieve deviceId",
"packageName": "@react-native-windows/telemetry",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ function verifyTestCommandTelemetryProcessor(
// Verify basics
const commonProperties = properties!.common;
expect(commonProperties.commandName).toBe('test-command');
// Verify LocalId
const expectedLocalId = TelemetryTest.getCommonProperty('deviceId');
expect(envelope.ext?.device?.localId).toBeDefined();
expect(envelope.ext?.device?.localId).toBe(expectedLocalId);
expect(commonProperties.device?.localId).toBe(expectedLocalId); // Only if you know it's set in the event, not in static commonProperties

// Verify versions info
const versions = properties!.versions;
Expand Down
4 changes: 3 additions & 1 deletion packages/@react-native-windows/telemetry/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export class Telemetry {
// Populate Part A extensions
telemetryItem.ext = {};
telemetryItem.ext.device = {
id: Telemetry.commonProperties.deviceId,
localId: Telemetry.commonProperties.deviceId,
deviceClass: Telemetry.commonProperties.deviceClass,
};
telemetryItem.ext.os = {
Expand All @@ -385,6 +385,8 @@ export class Telemetry {
numCPUs: Telemetry.commonProperties.numCPUs,
totalMemory: Telemetry.commonProperties.totalMemory,
diskFreeSpace: Telemetry.commonProperties.deviceDiskFreeSpace,
localId: Telemetry.commonProperties.deviceId,
deviceClass: Telemetry.commonProperties.deviceClass,
},
nodePlatform: Telemetry.commonProperties.nodePlatform,
nodeArchitecture: Telemetry.commonProperties.nodeArchitecture,
Expand Down
Loading