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

Consult about a logic problem in the code #514

Open
zishang520 opened this issue Oct 8, 2023 · 0 comments
Open

Consult about a logic problem in the code #514

zishang520 opened this issue Oct 8, 2023 · 0 comments

Comments

@zishang520
Copy link

zishang520 commented Oct 8, 2023

When I reviewed the code, the code here:

if (
!requestId ||
!(this.requests.has(requestId) || this.ackRequests.has(requestId))
) {
debug("ignoring unknown request");
return;
}

If requestId does not exist in this.requests, but requestId exists in this.ackRequests, the code will continue to execute:

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

I'm wondering if there is a problem with this business logic? If there is no problem, is this.ackRequests.has(requestId) a redundant condition?

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

No branches or pull requests

1 participant