File tree 2 files changed +13
-16
lines changed
2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -26,24 +26,22 @@ export class DeferredPromise<T> extends Promise<T> {
26
26
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
27
this . reject = rejectFn ! ;
28
28
29
- if ( timeout !== undefined ) {
29
+ if ( timeout !== undefined && onTimeout ) {
30
30
this . timeoutId = setTimeout ( ( ) => {
31
- onTimeout ?. ( this . resolve , this . reject ) ;
31
+ onTimeout ( this . resolve , this . reject ) ;
32
32
} , timeout ) ;
33
33
}
34
34
35
- if ( executor ) {
36
- executor (
37
- ( value : T ) => {
38
- if ( this . timeoutId ) clearTimeout ( this . timeoutId ) ;
39
- this . resolve ( value ) ;
40
- } ,
41
- ( reason : Error ) => {
42
- if ( this . timeoutId ) clearTimeout ( this . timeoutId ) ;
43
- this . reject ( reason ) ;
44
- }
45
- ) ;
46
- }
35
+ executor (
36
+ ( value : T ) => {
37
+ if ( this . timeoutId ) clearTimeout ( this . timeoutId ) ;
38
+ this . resolve ( value ) ;
39
+ } ,
40
+ ( reason : Error ) => {
41
+ if ( this . timeoutId ) clearTimeout ( this . timeoutId ) ;
42
+ this . reject ( reason ) ;
43
+ }
44
+ ) ;
47
45
}
48
46
49
47
static fromPromise < T > ( promise : Promise < T > , options : DeferredPromiseOptions < T > = { } ) : DeferredPromise < T > {
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export class Telemetry {
77
77
}
78
78
79
79
/**
80
- * @returns A hashed, unique identifier for the running device or `undefined ` if not known.
80
+ * @returns A hashed, unique identifier for the running device or `"unknown" ` if not known.
81
81
*/
82
82
private async getDeviceId ( ) : Promise < string > {
83
83
try {
@@ -126,7 +126,6 @@ export class Telemetry {
126
126
public getCommonProperties ( ) : CommonProperties {
127
127
return {
128
128
...this . commonProperties ,
129
- device_id : this . commonProperties . device_id ,
130
129
mcp_client_version : this . session . agentRunner ?. version ,
131
130
mcp_client_name : this . session . agentRunner ?. name ,
132
131
session_id : this . session . sessionId ,
You can’t perform that action at this time.
0 commit comments