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({
3030 return connectionStringUrl . toString ( ) ;
3131 }
3232
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" ;
4435
4536 // Build the extended appName format: appName--deviceId--clientName
4637 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;
1818 * ```
1919 */
2020export async function getDeviceIdForConnection ( ) : Promise < string > {
21+ const controller = new AbortController ( ) ;
22+
2123 try {
2224 const deviceId = await getDeviceId ( {
2325 getMachineId : ( ) => nodeMachineId . machineId ( true ) ,
@@ -34,7 +36,7 @@ export async function getDeviceIdForConnection(): Promise<string> {
3436 break ;
3537 }
3638 } ,
37- abortSignal : new AbortController ( ) . signal ,
39+ abortSignal : controller . signal ,
3840 } ) ;
3941 return deviceId ;
4042 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments