Fix incorrect assumption on device id's

Summary: In dev mode a (further harmless) error will be triggered if the self inspection plugin is loaded, since the device_id is empty. empty device id's however are fine; the represent the host device (Mac / Win devices)

Reviewed By: passy

Differential Revision: D26814269

fbshipit-source-id: 281fc591c1df47092011b4140099fc7138718b43
This commit is contained in:
Michel Weststrate
2021-03-04 05:59:40 -08:00
committed by Facebook GitHub Bot
parent 163799cf89
commit f8faeb2690

View File

@@ -63,7 +63,8 @@ export function buildClientId(clientInfo: {
device: string; device: string;
device_id: string; device_id: string;
}): string { }): string {
for (const key of ['app', 'os', 'device', 'device_id'] as Array< // N.B.: device_id can be empty, which designates the host device
for (const key of ['app', 'os', 'device'] as Array<
keyof ClientIdConstituents keyof ClientIdConstituents
>) { >) {
if (!clientInfo[key]) { if (!clientInfo[key]) {