Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is this.ackRequests.has(requestId) a redundant condition? #549

Open
zishang520 opened this issue Sep 19, 2024 · 2 comments · May be fixed by #550
Open

Question: Is this.ackRequests.has(requestId) a redundant condition? #549

zishang520 opened this issue Sep 19, 2024 · 2 comments · May be fixed by #550

Comments

@zishang520
Copy link

If requestId does not exist in this.requests, but exists in this.ackRequests:

!(this.requests.has(requestId) || this.ackRequests.has(requestId))

L537 will have an exception:

const request = this.requests.get(requestId);

@darrachequesne
Copy link
Member

Good catch! It looks like it is indeed redundant. Would you mind opening a PR?

zishang520 added a commit to zishang520/socket.io-redis-adapter that referenced this issue Sep 21, 2024
@zishang520
Copy link
Author

zishang520 commented Sep 21, 2024

PR submitted.

Although the if(this.ackRequests.has(requestId)) condition in L510 is met and the function is successfully exited, combined with the following code, there may still be problems in some extreme cases? Maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants