Skip to content

Commit

Permalink
fix: return undefined as machine id if it can't be determined
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Sep 24, 2024
1 parent 51c5e70 commit 3da8a9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/@sanity/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ function installProcessExitHack(finalTask: () => Promise<unknown>) {
async function getDeviceId() {
try {
return await machineId()
} catch(error) {
console.error('Failed to get device ID:', error)
return 'unknown device id'
} catch (error) {
return undefined
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface CliBaseCommandContext {
}

export interface TelemetryUserProperties {
deviceId: string
deviceId: string | undefined
runtime: string
runtimeVersion: string
cliVersion: string
Expand Down

0 comments on commit 3da8a9a

Please sign in to comment.