fix(triggers): repair broken name filter in ListTriggers (EN-1218) - #181
fix(triggers): repair broken name filter in ListTriggers (EN-1218)#181flemzord wants to merge 1 commit into
Conversation
The name filter used Where("Name ILIKE '%?%';", name): bun substitutes
the ? placeholder even inside the string literal, producing invalid SQL
(the value is quoted inside the literal and the stray ; lands mid-WHERE).
Any GET /triggers?name=... request therefore returned a 500.
Use a proper parameterized predicate with the wildcards on the argument,
and add an integration test covering substring/case-insensitive matching.
|
Warning Review limit reached
More reviews will be available in 55 minutes and 18 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #199, which consolidates this change with the related reliability and safety fixes on top of the current main branch. |
Problem (C4)
ListTriggersbuilt its name filter as:bun substitutes the
?placeholder even inside the string literal, so this renders asName ILIKE '%'foo'%';— the value is spliced inside the quotes and the stray;lands in the middle of the WHERE clause (it is ANDed withdeleted_at is null). EveryGET /triggers?name=...request (v1 & v2) returned a 500.Fix
Proper parameterized predicate, wildcards on the argument.
Test
Adds
TestListTriggersNameFilter(integration) covering substring match, case-insensitive match, no-match, and the unfiltered case — none existed before.Part of the deep-review remediation series. Severity: CRITICAL.