File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -30,17 +30,8 @@ export async function setAppNameParamIfMissing({
30
30
return connectionStringUrl . toString ( ) ;
31
31
}
32
32
33
- // Get deviceId if not provided
34
- let deviceId = components . deviceId ;
35
- if ( ! deviceId ) {
36
- deviceId = await getDeviceIdForConnection ( ) ;
37
- }
38
-
39
- // Get clientName if not provided
40
- let clientName = components . clientName ;
41
- if ( ! clientName ) {
42
- clientName = "unknown" ;
43
- }
33
+ const deviceId = components . deviceId || ( await getDeviceIdForConnection ( ) ) ;
34
+ const clientName = components . clientName || "unknown" ;
44
35
45
36
// Build the extended appName format: appName--deviceId--clientName
46
37
const extendedAppName = `${ components . appName } --${ deviceId } --${ clientName } ` ;
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export const DEVICE_ID_TIMEOUT = 3000;
18
18
* ```
19
19
*/
20
20
export async function getDeviceIdForConnection ( ) : Promise < string > {
21
+ const controller = new AbortController ( ) ;
22
+
21
23
try {
22
24
const deviceId = await getDeviceId ( {
23
25
getMachineId : ( ) => nodeMachineId . machineId ( true ) ,
@@ -34,7 +36,7 @@ export async function getDeviceIdForConnection(): Promise<string> {
34
36
break ;
35
37
}
36
38
} ,
37
- abortSignal : new AbortController ( ) . signal ,
39
+ abortSignal : controller . signal ,
38
40
} ) ;
39
41
return deviceId ;
40
42
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments