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

Dead code in MatrixHandler #1837

Open
f0x52 opened this issue Dec 6, 2024 · 0 comments
Open

Dead code in MatrixHandler #1837

f0x52 opened this issue Dec 6, 2024 · 0 comments

Comments

@f0x52
Copy link
Contributor

f0x52 commented Dec 6, 2024

let body = cacheBody.trim().substring(0, this.config.replySourceMaxLength);
const nextNewLine = body.indexOf("\n");
if (nextNewLine !== -1) {
body = body.substring(0, nextNewLine);
}

A truncated version of the cacheBody is stored in the variable body here, which is never used afterwards.
Wasn't caught by eslint / editor greying it out because of #L1117, but it's essentially not accomplishing anything.
It's unclear to me if this part should just be removed, or if it is desired to strip the cacheBody before storing it in the eventCache. If the latter is true, this should probably use trimString() instead, like is done here

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