Open lanitochka17 opened 12 hours ago
Triggered auto assignment to @garrettmknight (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Search - Empty row in "In" field when searching for messages in inaccessible group chat
We always wrap the value with "" if the value contains special characters although it is already wrapped with "" https://github.com/Expensify/App/blob/76e0d1326f0d5b82115add4483798c4824b6e877/src/libs/SearchQueryUtils.ts#L39-L45
Don't wrap the value with "" again if the value already wrapped with ""
function sanitizeSearchValue(str: string) {
const regexpDoubleQuotes = /^".*"$/;
const regexp = /[^A-Za-z0-9_@./#&+\-\\';,"]/g;
if (regexp.test(str) && !regexpDoubleQuotes.test(str)) {
return `"${str}"`;
}
return str;
}
Or change to
function sanitizeSearchValue(str: string) {
const regexp = /^(?!".*"$).*[^A-Za-z0-9_@./#&+\-\\';,"]/;
if (regexp.test(str)) {
return `"${str}"`;
}
return str;
}
Search - Quotation marks in search query increase each time when switching status
In the saveSearch
function queryJSON
is converted to a JSON string before it's sent to WRITE_COMMANDS.SAVE_SEARCH
.
The problem is that JSON.stringify()
will add a pair of double quotation marks to the beginning and end of the keywords in the filter array to make sure the JSON string is up to JSON's expectations.
After the search is saved, the keyword filters have the quotation marks and the searchParser.parse
function will treat the extra quotation marks as part of the keyword.
We should parse the keyword filters to remove the extra double quotation marks by using JSON.parse
over here to change the line to something like below.
keywords.map((filter) => JSON.parse(filter.right)).flat()
We could remove the extra double quotation marks manually with regex either on this line or after this line.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.65-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+kh0811007@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The search query will not change when switching status
Actual Result:
The quotation marks in search query increase each time when switching status
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/de7422e5-77f8-4823-ac3a-189c08bfce5a
View all open jobs on GitHub