Open lanitochka17 opened 1 day ago
Triggered auto assignment to @Christinadobrzyn (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.
Triggered auto assignment to @Gonals (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
We think that this bug might be related to #wave-collect - Release 1
Regression PR: https://github.com/Expensify/App/pull/50838
It's because when we set the room description to a number e.g 2222222 and when displaying the room description, we use getReportDescription
function for the report description value
Inside this function we will parse the report.description
using JSON parse and return the html value, if there's an error meaning the value could not be parse or something else, we will simply return report.description
https://github.com/Expensify/App/blob/6c33bba59c3305d59c96b265183473bc7ffed2e0/src/libs/ReportUtils.ts#L4261-L4271
When we set the room description something like testsd
not a number, it will work because the JSON parse cannot parse string value which will run this return statement
https://github.com/Expensify/App/blob/6c33bba59c3305d59c96b265183473bc7ffed2e0/src/libs/ReportUtils.ts#L4269-L4271
But when we set a number value inside the room description, the JSON parse did not throw an error instead returning the report description number in type of number not string
So when there's no error this catch block will not run
https://github.com/Expensify/App/blob/6c33bba59c3305d59c96b265183473bc7ffed2e0/src/libs/ReportUtils.ts#L4269-L4271
But instead it will run this
https://github.com/Expensify/App/blob/6c33bba59c3305d59c96b265183473bc7ffed2e0/src/libs/ReportUtils.ts#L4267-L4268
Since it's number so when we return objectDescription.html ?? ''
it will return empty string
Instead of returning objectDescription.html ?? ''
we can return this:
const reportDescription = report?.description;
const objectDescription = JSON.parse(reportDescription) as {html: string};
return objectDescription.html ?? report?.description ?? '';
Unable to save room description with numbers only.
We are passing only strings for the room description; if we receive a number, it cannot be processed as a string. here https://github.com/Expensify/App/blob/6c33bba59c3305d59c96b265183473bc7ffed2e0/src/libs/ReportUtils.ts#L4265-L4271
We should cast numbers to string before processing like this
try {
const reportDescription = report?.description;
const objectDescription = JSON.parse(reportDescription) as {html: string};
const newObjectDescription = {html:String(objectDescription)};
return newObjectDescription.html ?? '';
} catch (error) {
return report?.description ?? '';
}
@Gonals I can reproduce this, can this go external? Is it a blocker?
@NJ-2020 -thanks for finding what looks like the regression, i pinged the PR authors in slack 🙏
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.56-0 Reproducible in staging?: Y Reproducible in production?: N If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A 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+jp_11311024@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Description is saved
Actual Result:
Description is empty
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/9a6cf043-6c88-4b89-a187-2c8d6b505534
View all open jobs on GitHub