fix: four correctness bugs — blocked-phrase bypass, empty-phrase scoring, proxyAuthors leak#58
Open
davelindsay84 wants to merge 4 commits into
Open
fix: four correctness bugs — blocked-phrase bypass, empty-phrase scoring, proxyAuthors leak#58davelindsay84 wants to merge 4 commits into
davelindsay84 wants to merge 4 commits into
Conversation
Discord.js Collection iterates as [id, Message] pairs, not bare Messages. Passing .values() gives replaceFirstMessage the Message objects it expects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ing, proxyAuthors leak - config.js: trim whitespace from SearchPhrasesToBlock entries so that 'bad, word' in the env var does not create a ' word' entry that silently bypasses the block - replacer.js: apply normalizeUnicode to the replacement text before the blocked-phrase check, closing the curly-quote bypass - scoring.js: guard parseScoreLine against bare '++' / '--' lines that would insert an empty-string phrase into the DB - reactions.js: cap proxyAuthors Map at 1000 entries (FIFO eviction) to prevent unbounded growth over long uptime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zippy1981
requested changes
May 5, 2026
| // of the command issuer. | ||
| // Capped at 1000 entries (FIFO) — the oldest entry is evicted when the cap is | ||
| // hit, since stale proxy mappings for long-past messages are never useful. | ||
| const PROXY_AUTHORS_MAX = 1000; |
zippy1981
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.js: Trim whitespace fromSearchPhrasesToBlockentries —SEARCH_PHRASES_TO_BLOCK=bad, wordwas creating' word'with a leading space, making the block silently ineffectivereplacer.js: ApplynormalizeUnicodeto the replacement text before the blocked-phrase check — curly-quote variants of a blocked replacement phrase were bypassing the filterscoring.js: GuardparseScoreLineagainst bare++/--/—lines with no phrase text, which were inserting empty-string rows into the DBreactions.js: CapproxyAuthorsMap at 1000 entries with FIFO eviction to prevent unbounded growth over long uptimeTest plan
SearchPhrasesToBlocktrims whitespace from each entry++/--messages produce no DB entries🤖 Generated with Claude Code