fix(server): name search in contact_get/product_get returns empty (drop 'like' wildcards) - #2
Conversation
…t_get queries AbraFlexi 'like' is a plain case-insensitive substring match and takes no wildcards; wrapping the term in '*...*' made contact_get/product_get name searches match a literal '*' and always return empty. Fixes #1
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe filtering logic for the Changesnazev filter fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Related issues:
Suggested labels: bug, backend Suggested reviewers: VitexSoftware maintainers 🐰 A wildcard once hid the name, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Fixes #1.
Problem
contact_get(nazev=...)andproduct_get(nazev=...)always returned an empty set. They built the filter asnazev like '*{nazev}*'.Root cause
AbraFlexi's
likeoperator is a plain case-insensitive substring match and takes no wildcards. The*...*wrapping made AbraFlexi look for a literal*inside the value, so nothing ever matched.Verified directly against raw AbraFlexi REST (record
nazev = "AAA Tondaaa"):like '*Tond*'andlike '%Tond%'→ 0 rows, whilelike 'Tond',like 'ondaa'(mid-string) andlike 'tond'(lowercase) → 1 row.Fix
Pass the term as a bare substring:
nazev like '{nazev}'. Applied to bothcontact_get(adresar) andproduct_get(cenik).Verification (production)
contact_get(nazev="Voda")→[]evidence_get(evidence="adresar", filter_expr="nazev like 'Voda'")→Vodafone Czech Republic a.s.✅The
evidence_get/evidence_listfilter_exprpassthrough is unaffected — it forwards raw expressions correctly.Summary by CodeRabbit