issue: https://linear.app/comm/issue/ENG-4055/search-endpoint-failing-when-called-with-only-a-stopword
When searchMessagesInSingleChat was passed a string with only stopwords, they were stripped away by processQueryForSearch and the pattern variable was '+', which is not a valid patter for MATCH AGAINST query
Details
Details
call the endpoint with a string that had only stopwords, checked that there are no errors. Called the endpoint with a string containing both a stopword and a non stopword, checked that it returns correct values. Checked he endpoint with a string containing only a non stopword.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- inka/validate_endpoint
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
I could also just check if pattern === '+' and not change the processQueryForSearch function, but I like this approach better
keyserver/src/database/search-utils.js | ||
---|---|---|
139 ↗ | (On Diff #27524) | maybe worth adding a test case with something like: expect(processQueryForSearch(stopWord)).toBe(''); |