You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Expense preview- Report title part of report preview is blank briefly after submitting expense #59525
Version Number: 9.1.22-2 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only If this was caught during regression testing, add the test name, ID and link from TestRail: Exp #58479 Email or phone of affected tester (no customers):applausetester+sdsoidsj@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Log in with Expensifail account.
Go to staging.new.expensify.com
Go to workspace chat.
Submit a manual expense.
Note that the report title part of the expense report preview is blank briefly.
Click Submit.
Go offline.
Submit another manual expense.
Expected Result:
The report title part of the expense report preview should not be blank after submitting the expense.
Actual Result:
In offline mode, the report title part of the expense report preview is blank after submitting the expense.
In online mode, the same part is blank briefly after submitting the expense.
🚨 Edited by proposal-police: This proposal was edited at 2025-04-02 10:48:29 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In offline mode, the report title part of the expense report preview is blank after submitting the expense.
In online mode, the same part is blank briefly after submitting the expense.
What is the root cause of that problem?
We don't return the childReportName when we run buildOptimisticReportPreview to update Onyx data
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
In offline mode, the report title part of the expense report preview is blank after submitting the expense.
In online mode, the same part is blank briefly after submitting the expense.
What is the root cause of that problem?
We're displaying the report title in report preview from childReportName of REPORTPREVIEW action,
But childReportName is empty when we create optimistic data for REPORTPREVIEW action that leads the report title is empty briefly until the API is done.
I noticed that we have an inconsistency for the expense report's reportName. The default report title formula is {report:type} {report:startdate}, and we used it to generate reportName in optimistic data here but the backend return the reportName with the formula is {report:type} {report:reportID}. We should fix it from backend side to change the default formula of the title field to {report:type} {report:reportID} or fix reportName of new expense report.
The IOU report is displaying IOU, but this report has the custom report name in front-end; then we can use getReportName(iouReport) and fallback it to action.childReportName if iouReport data isn't available
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add a unit test for buildOptimisticReportPreview and verify that the childReportName is equal to iouReport.reportName.
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Expense preview- Report title part of report preview is blank briefly after submitting expense[/-][+][$250] Expense preview- Report title part of report preview is blank briefly after submitting expense[/+]on Apr 3, 2025
but the backend return the reportName with the formula is {report:type} {report:reportID}. We should fix it from backend side to change the default formula of the title field to {report:type} {report:reportID}
@nkdengineer I got confused here. Can you clarify what it means? I'm interpreting that because BE is already returning {report:type} {report:reportID}, why do we also need to change the default to {report:type} {report:reportID}?
@neil-marcellini Can you help advise if it would make sense to move forward with this while you're working on the linked issue?
@neil-marcellini This is only the back-end part of this issue. We still have the front-end bug with optimistic data here that we need to fix this, please help to re-open this issue.
The linked issue is specifically for the frontend.
@neil-marcellini I mean, we're having another bug with Expense preview that isn't related to this issue.
The current issue is that the Report title of report preview will have the format "Expenses yyyy-mm-dd" briefly (FE optimistic), then change to "Expenses #id" format (BE response).
The problem we want to confirm here is will this issue fix this backend bug
Yes we'll make sure the frontend and backend report title computations work the same way.
@neil-marcellini Got it now. But our bug here is that the report preview doesn't show the expense report name in offline. And the RCA is not related to the report title computations. It's related to childReportName isn't set of the REPORTPREVIEW action.
Agreed with @nkdengineer, the original bug of this issue is report title part is blank because we missed adding optimistic data for report preview. You can take a look at this proposal #59525 (comment)@neil-marcellini
Agreed with @nkdengineer, the original bug of this issue is report title part is blank because we missed adding optimistic data for report preview. You can take a look at this proposal #59525 (comment)@neil-marcellini
Right that would be good to fix, but I'm still not clear on whether we can fix this without creating an inconsistency between the optimistic and backend data. If so, please update your proposal to do exactly that and explain why there is no inconsistency. If not, we should keep this closed and fix it holistically.
I see. Actually, I'm unsure what the correct way to fix it from FE side. I mean, should we use iouReport.reportName or generate its own report name based on policy.fieldList.text_title.defaultValue. I'm happy to close this issue and fix it holistically here #59525 (comment)
@isabelastisser, because the proposal has been accepted and the PR was created. Can you process payment here for @nkdengineer and me? Then we can close this issue.
Activity
melvin-bot commentedon Apr 2, 2025
Triggered auto assignment to @isabelastisser (
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.daledah commentedon Apr 2, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-02 10:48:29 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In offline mode, the report title part of the expense report preview is blank after submitting the expense.
In online mode, the same part is blank briefly after submitting the expense.
What is the root cause of that problem?
We don't return the
childReportNamewhen we runbuildOptimisticReportPreviewto update Onyx dataApp/src/libs/ReportUtils.ts
Lines 5953 to 5980 in 66f28d3
It leads to
action.childReportNamebeing empty when creating an expense in offlineApp/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Lines 483 to 488 in 66f28d3
What changes do you think we should make in order to solve the problem?
We have some ways to fix it as follows
The simplest way is that we will not show this View when there is no
childReportNameWe can add fallback here like 'Expense report'
App/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Line 487 in 66f28d3
childReportNameinbuildOptimisticReportPreviewby usingpopulateOptimisticReportFormulafunctionDEFAULT_REPORT_ID_PATTERN: '{report:type} {report:reportID}'populateOptimisticReportFormulato match withDEFAULT_REPORT_ID_PATTERNherechildReportNameinbuildOptimisticReportPreviewfunctionWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
nkdengineer commentedon Apr 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
In offline mode, the report title part of the expense report preview is blank after submitting the expense.
In online mode, the same part is blank briefly after submitting the expense.
What is the root cause of that problem?
We're displaying the report title in report preview from
childReportNameofREPORTPREVIEWaction,App/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Lines 483 to 488 in 66f28d3
But
childReportNameis empty when we create optimistic data forREPORTPREVIEWaction that leads the report title is empty briefly until the API is done.App/src/libs/ReportUtils.ts
Lines 5953 to 5980 in 66f28d3
What changes do you think we should make in order to solve the problem?
childReportNameasiouReport.reportNamehereApp/src/libs/ReportUtils.ts
Lines 5953 to 5980 in 66f28d3
I noticed that we have an inconsistency for the expense report's reportName. The default report title formula is
{report:type} {report:startdate}, and we used it to generatereportNamein optimistic data here but the backend return thereportNamewith the formula is{report:type} {report:reportID}. We should fix it from backend side to change the default formula of the title field to{report:type} {report:reportID}or fixreportNameof new expense report.IOU, but this report has the custom report name infront-end; then we can usegetReportName(iouReport)and fallback it toaction.childReportNameifiouReportdata isn't availableApp/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Lines 483 to 488 in 66f28d3
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add a unit test for
buildOptimisticReportPreviewand verify that thechildReportNameis equal toiouReport.reportName.What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Expense preview- Report title part of report preview is blank briefly after submitting expense[/-][+][$250] Expense preview- Report title part of report preview is blank briefly after submitting expense[/+]melvin-bot commentedon Apr 3, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021907791019793338504
melvin-bot commentedon Apr 3, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)hoangzinh commentedon Apr 4, 2025
@nkdengineer I got confused here. Can you clarify what it means? I'm interpreting that because BE is already returning
{report:type} {report:reportID}, why do we also need to change the default to{report:type} {report:reportID}?17 remaining items
nkdengineer commentedon Apr 14, 2025
@neil-marcellini This is only the back-end part of this issue. We still have the front-end bug with optimistic data here that we need to fix this, please help to re-open this issue.
neil-marcellini commentedon Apr 14, 2025
The linked issue is specifically for the frontend.
nkdengineer commentedon Apr 14, 2025
@neil-marcellini I mean, we're having another bug with Expense preview that isn't related to this issue.
The problem we want to confirm here is will this issue fix this backend bug
neil-marcellini commentedon Apr 14, 2025
Yes we'll make sure the frontend and backend report title computations work the same way.
nkdengineer commentedon Apr 15, 2025
@neil-marcellini Got it now. But our bug here is that the report preview doesn't show the expense report name in offline. And the RCA is not related to the
report title computations. It's related tochildReportNameisn't set of theREPORTPREVIEWaction.hoangzinh commentedon Apr 15, 2025
Agreed with @nkdengineer, the original bug of this issue is report title part is blank because we missed adding optimistic data for report preview. You can take a look at this proposal #59525 (comment) @neil-marcellini
nkdengineer commentedon Apr 23, 2025
@neil-marcellini Please help to check this comment above.
neil-marcellini commentedon Apr 25, 2025
Right that would be good to fix, but I'm still not clear on whether we can fix this without creating an inconsistency between the optimistic and backend data. If so, please update your proposal to do exactly that and explain why there is no inconsistency. If not, we should keep this closed and fix it holistically.
hoangzinh commentedon Apr 27, 2025
I see. Actually, I'm unsure what the correct way to fix it from FE side. I mean, should we use
iouReport.reportNameor generate its own report name based onpolicy.fieldList.text_title.defaultValue. I'm happy to close this issue and fix it holistically here #59525 (comment)hoangzinh commentedon Apr 27, 2025
@isabelastisser, because the proposal has been accepted and the PR was created. Can you process payment here for @nkdengineer and me? Then we can close this issue.
isabelastisser commentedon Apr 28, 2025
Payment summary:
$250 for C+ review to @hoangzinh,
PENDINGin NewDot.$250 for proposal to @nkdengineer. Paid in Upwork here.
hoangzinh commentedon Apr 28, 2025
Thank you @isabelastisser. I requested in ND
garrettmknight commentedon May 2, 2025
$250 approved for @hoangzinh