Skip to content

Commit

Permalink
fix: fallback to device name when platform cant be derrived
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Mar 12, 2024
1 parent aa76613 commit 4aa895b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/expoDebuggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ export class ExpoDebuggersProvider implements vscode.DebugConfigurationProvider
}

// Resolve the target device config to inspect
const { platform, ...deviceConfig } = await resolveDeviceConfig(config, project);
const { platform, deviceName, ...deviceConfig } = await resolveDeviceConfig(config, project);

featureTelemetry('debugger', `${DEBUG_TYPE}`, { platform, expoVersion: project.expoVersion });
featureTelemetry('debugger', `${DEBUG_TYPE}`, {
platform,
deviceName,
expoVersion: project.expoVersion,
});

return { ...config, ...deviceConfig };
}
Expand All @@ -207,8 +211,11 @@ async function resolveDeviceConfig(config: ExpoDebugConfig, project: ExpoProject
throw new Error('Expo debug session aborted.');
}

const platform = inferDevicePlatform(device);

return {
platform: inferDevicePlatform(device) ?? 'unknown',
platform: platform ?? 'unknown',
deviceName: platform ? undefined : device.deviceName ?? 'unknown',

// The address of the device to connect to
websocketAddress:
Expand Down

0 comments on commit 4aa895b

Please sign in to comment.