Skip to content

Commit

Permalink
fix: requerst response missmatch, clear request
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Jul 31, 2024
1 parent d662140 commit 569e962
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/wss.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const requestPool = ({
pool.set(id, {
id,
connectionId,
timeOut,
resolve: (...args) => {
clearTimeout(timeOut);
pool.delete(id);
Expand Down Expand Up @@ -302,6 +303,9 @@ const Wss = ({
if (decoded.id && this.requests.get(decoded.id)) {
return this.requests.resolve(decoded.id, decoded);
}
if (this.isRequest && !this.isRequest(decoded)) {
throw new Error('MessageMissMatch');
}
// nowhere to send message
if (!config?.sink) {
return;
Expand Down

0 comments on commit 569e962

Please sign in to comment.