suppress the error message after it has shown once

This commit is contained in:
sawka
2024-08-29 18:08:05 -07:00
parent 53d3ad04b7
commit 6e704f74e3
2 changed files with 6 additions and 3 deletions
+6 -1
View File
@@ -91,6 +91,8 @@ function sendRawRpcMessage(msg: RpcMessage) {
globalWS.pushMessage(wsMsg);
}
const notFoundLogMap = new Map<string, boolean>();
function handleIncomingRpcMessage(msg: RpcMessage, eventHandlerFn: (event: WaveEvent) => void) {
const isRequest = msg.command != null || msg.reqid != null;
if (isRequest) {
@@ -111,7 +113,10 @@ function handleIncomingRpcMessage(msg: RpcMessage, eventHandlerFn: (event: WaveE
}
const entry = openRpcs.get(msg.resid);
if (entry == null) {
console.log("rpc response generator not found", msg);
if (!notFoundLogMap.has(msg.resid)) {
notFoundLogMap.set(msg.resid, true);
console.log("rpc response generator not found", msg);
}
return;
}
entry.msgFn(msg);