You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnthis.reject(newError(`Invalid message from plugin. ${JSON.stringify(incomingMessage,null,2)}`))
64
64
}
65
65
66
-
if(incomingMessage.cmd===this.resultCmd){
67
-
this.resolve(incomingMessage);
66
+
if(this.message.isSameRequest(message)){
67
+
this.resolve(message);
68
68
}else{
69
69
this.startOrResetTimeout();
70
70
}
71
71
};
72
72
73
-
privatereject=(err: Error)=>{
73
+
reject=(err: Error)=>{
74
74
if(this.timerId.hasRef()){
75
75
clearTimeout(this.timerId);
76
76
}
77
77
78
78
this.promiseReject(err)
79
79
}
80
80
81
-
privateresolve=(value: IpcMessageV2)=>{
81
+
resolve=(value: PluginMessage)=>{
82
82
if(this.timerId.hasRef()){
83
83
clearTimeout(this.timerId);
84
84
}
85
85
86
86
this.promiseResolve(value)
87
87
}
88
88
89
-
privatestartOrResetTimeout=()=>{
89
+
startOrResetTimeout=()=>{
90
90
if(this.timerId?.hasRef()){
91
91
clearTimeout(this.timerId);
92
92
}
@@ -95,11 +95,11 @@ export class MessageForResultSender {
95
95
96
96
// Use date here to convert ms to minutes
97
97
constdate=newDate(this.timeout)
98
-
this.reject(newError(`Plugin did not respond in ${date.getMinutes().toString().padStart(2,'0')}:${date.getSeconds().toString().padStart(2,'0')} minutes: ${this.cmd}`))
98
+
this.reject(newError(`Plugin did not respond in ${date.getMinutes().toString().padStart(2,'0')}:${date.getSeconds().toString().padStart(2,'0')} minutes: ${this.message.cmd}`))
99
99
},this.timeout);
100
100
}
101
101
102
-
privatevalidateIpcMessage(response: unknown): response is IpcMessageV2{
102
+
validateIpcMessage(response: unknown): response is IpcMessageV2{
0 commit comments