return this.uiServices.get(protocolVersion)?.requestHandler(request);
}
+ public hasResponseHandler(uuid: string): boolean {
+ return this.responseHandlers.has(uuid);
+ }
+
protected startHttpServer(): void {
if (this.httpServer.listening === false) {
this.httpServer.listen(this.uiServerConfiguration.options);
public sendResponse(response: ProtocolResponse): void {
const [uuid, payload] = response;
try {
- if (this.responseHandlers.has(uuid) === true) {
+ if (this.hasResponseHandler(uuid) === true) {
const res = this.responseHandlers.get(uuid) as ServerResponse;
res
.writeHead(this.responseStatusToStatusCode(payload.status), {
public sendResponse(response: ProtocolResponse): void {
const responseId = response[0];
try {
- if (this.responseHandlers.has(responseId)) {
+ if (this.hasResponseHandler(responseId)) {
const ws = this.responseHandlers.get(responseId) as WebSocket;
if (ws?.readyState === WebSocket.OPEN) {
ws.send(JSON.stringify(response));
// }
public sendResponse(messageId: string, responsePayload: ResponsePayload): void {
- this.uiServer.sendResponse(this.uiServer.buildProtocolResponse(messageId, responsePayload));
+ if (this.uiServer.hasResponseHandler(messageId)) {
+ this.uiServer.sendResponse(this.uiServer.buildProtocolResponse(messageId, responsePayload));
+ }
}
public logPrefix = (modName: string, methodName: string): string => {