Fix literal subscriber search - #3169
Open
mherzog4 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Issues Found
No issues found.
Summary
Total issues: 0 critical, 0 important, 0 minor.
Overall Verdict
Status: Patch is correct
Explanation: The diff cleanly replaces regex-based search on subscriber name/email with a case-insensitive literal substring check using STRPOS(LOWER(...), LOWER($n)) across the affected queries. The SQL remains syntactically valid and preserves the existing parameter/CASE logic without introducing new correctness or safety issues.
Review generated by Hodor (model: gpt-5.2)
Review Metrics — 6 turns, 5 tool calls, 41s
- Tokens: in
4.7K| cached22.0K| out2.2K(total28.9K) - Cost:
$0.0422
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
Treat the subscriber
searchparameter as a case-insensitive literal substring across listing, count, CSV export, and bulk-action queries.Root cause
The simple search value was passed directly to PostgreSQL’s
~*regex operator. In a valid subaddress such asuser+subaddr@example.net,+is interpreted as a regex quantifier instead of a literal character, so searching for the exact email returns no rows. Other regex metacharacters can likewise change the meaning of a normal text search.This replaces the regex comparisons with
STRPOS(LOWER(column), LOWER(search)) > 0. The separate advanced SQL-expressionqueryfeature is unchanged, and this PR does not touch the admin frontend currently being replaced for v7.Verification
falseforuser+subaddr@example.net; the new comparison returnedtrueGET /api/subscribersreturned the seeded plus-address subscriber withtotal: 1GET /api/subscribers/exportexported that subscriberPUT /api/subscribers/query/listsmatched that subscriber and added the requested confirmed subscriptiongo test ./...go vet ./...go build -o /tmp/listmonk-build ./cmdgit diff --checkCloses #3167
AI disclosure
This contribution was developed with AI assistance (Codex).