App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Report - Report title not updating consistently for expenses created before default title set

Open vincdargento opened this issue 2 months ago • 32 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.2.55-3 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-1950/folder/15397164/57245516/1010741310 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 App Component: Money Requests

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open workpace chat
  3. Enable forced offline
  4. Create an expense
  5. Submit and approve
  6. Go to reports
  7. Change default report title as {report:type} {report:status}
  8. Go to workspace chat
  9. Create an an expense
  10. Submit and approve the expense
  11. Note the title header of expense created in step 4 and step 9
  12. Turn off forced offline
  13. Note the title header of expense created in step 4 and step 9
  14. Create a new workspace
  15. Add a manual expense
  16. Submit and approve the expense
  17. Go to reports
  18. Change default report title as {report:type} {report:status} 19.Go to workspace chat
  19. Create an an expense
  20. Submit and approve the expense
  21. Note the title header of expense created in step 4 and step 9

Expected Result:

Report name must not change to the report ID, the status must update correctly.

Actual Result:

Report name changes to the report ID, the status does not updated correctly.

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [x] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/faf65d18-41d0-4603-a646-728ebbdfd231

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021988963107730630971
  • Upwork Job ID: 1988963107730630971
  • Last Price Increase: 2025-12-25
Issue OwnerCurrent Issue Owner: @jjcoffee

vincdargento avatar Nov 12 '25 22:11 vincdargento

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.

melvin-bot[bot] avatar Nov 12 '25 22:11 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~021988963107730630971

melvin-bot[bot] avatar Nov 13 '25 13:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

melvin-bot[bot] avatar Nov 13 '25 13:11 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 20 '25 16:11 melvin-bot[bot]

No proposals yet, Melv.

jjcoffee avatar Nov 20 '25 16:11 jjcoffee

@garrettmknight @jjcoffee this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Nov 26 '25 21:11 melvin-bot[bot]

Posted on Slack to get some eyes on this.

jjcoffee avatar Nov 27 '25 08:11 jjcoffee

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 27 '25 16:11 melvin-bot[bot]

@jjcoffee Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 01 '25 00:12 melvin-bot[bot]

@garrettmknight Still no proposals on this, should we maybe ask for a retest?

jjcoffee avatar Dec 01 '25 08:12 jjcoffee

@garrettmknight i am working on it. soon give a proposal today

sandipanghos avatar Dec 03 '25 01:12 sandipanghos

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 04 '25 16:12 melvin-bot[bot]

@jjcoffee Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 05 '25 00:12 melvin-bot[bot]

Still no proposals.

jjcoffee avatar Dec 05 '25 10:12 jjcoffee

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 11 '25 16:12 melvin-bot[bot]

I will post a proposal by tomorrow EOD

sandipanghos avatar Dec 11 '25 16:12 sandipanghos

Proposal:

Please re-state the problem that we are trying to solve in this issue.

Expense old reports sometimes display the report ID as the title, and their status does not update correctly. This happens when the report name cannot be computed from the policy formula or is empty.

What is the root cause of that problem?

When the report title fails to compute based on the policy formula (due to missing, invalid, or incomplete data), the logic falls back to using the report ID as the title. This fallback occurs for both new and old reports, resulting in confusing and inconsistent report names for users. The failure to compute a proper title is not handled gracefully, so the report ID is shown instead of a meaningful name.

What changes do you think we should make in order to solve the problem?

  • Always attempt to generate the report title dynamically using the current policy formula for all reports—specifically for reports whose status is not "Approved" or higher. Implemented (Function: createExpenseReportTitleFromPolicyFormula)
  • Update the UI to use a utility function that computes the title from the formula and report/policy data, ensuring a meaningful name is always displayed.
    (Files changed: MoneyReportHeader, HeaderWithBackButton, AvatarWithDisplayName, MoneyRequestReportPreviewContent, ReportScreen; Function: createExpenseReportTitleFromPolicyFormula)
  • Standardize status mapping using a single utility that translates state and status numbers to the correct localized string. Added new statusNum "open" and use it instead of "draft" status.
    (Files changed: ReportNameUtils, CONST, SearchUIUtils, language files; Function: Implemented getReportStatus)
  • Ensure all translation keys (e.g., "open") exist in all language files.

What alternative solutions did you explore? (Optional)

  • Migrating all old reports in the database to have the new title format (more complex, less flexible).
  • Only updating titles for new reports (does not solve the problem for existing reports).

sandipanghos avatar Dec 13 '25 00:12 sandipanghos

@garrettmknight @jjcoffee I have fixed the issue in my local and tested . It is working perfectly. Please arrange a review .

sandipanghos avatar Dec 13 '25 00:12 sandipanghos

@jjcoffee my proposal will be review? will it be reviewed first?

sandipanghos avatar Dec 13 '25 11:12 sandipanghos

@jjcoffee I am a first-time contributor and 2 days before submitted a proposal for this issue Just wanted to check if any clarification is needed from my side. Thanks! Please provide a feedback on my proposal when you have time . No hurry. https://github.com/Expensify/App/issues/74998#issuecomment-3648650037

sandipanghos avatar Dec 14 '25 10:12 sandipanghos

@sandipanghos Welcome! 👋 Thanks for the proposal - you can generally expect proposals to be reviewed within 24 hours during the working week.

Regarding the proposal that you've posted, please ensure that you read the contributing guide thoroughly, including the section that links to the proposal template, which you should use and follow exactly.

jjcoffee avatar Dec 15 '25 09:12 jjcoffee

@sandipanghos Welcome! 👋 Thanks for the proposal - you can generally expect proposals to be reviewed within 24 hours during the working week.

Regarding the proposal that you've posted, please ensure that you read the contributing guide thoroughly, including the section that links to the proposal template, which you should use and follow exactly.

@jjcoffee

Proposal

Updated

sandipanghos avatar Dec 15 '25 09:12 sandipanghos

@jjcoffee Thanks for the guidance! I've updated my proposal to follow the official template exactly. Please let me know if any further adjustments are needed.

sandipanghos avatar Dec 15 '25 15:12 sandipanghos

@sandipanghos Thanks! Sorry to be pedantic, but please copy the proposal template exactly as it appears here.

Also a little bit of pre-feedback, please link to areas of code that you're referring to in both your root cause and solution.

For example, here you can link to where the policy formula is calculated:

When the report title fails to compute based on the policy formula (due to missing, invalid, or incomplete data), the logic falls back to using the report ID as the title.

The solution should also contain specific changes you propose to make to fix the issue (relating the changes back to the root cause). Note that in general posting entire code diffs is unhelpful.

jjcoffee avatar Dec 16 '25 15:12 jjcoffee

here ok will update as soon as possible

@sandipanghos Thanks! Sorry to be pedantic, but please copy the proposal template exactly as it appears here.

Also a little bit of pre-feedback, please link to areas of code that you're referring to in both your root cause and solution.

For example, here you can link to where the policy formula is calculated:

When the report title fails to compute based on the policy formula (due to missing, invalid, or incomplete data), the logic falls back to using the report ID as the title.

The solution should also contain specific changes you propose to make to fix the issue (relating the changes back to the root cause). Note that in general posting entire code diffs is unhelpful.

sandipanghos avatar Dec 17 '25 03:12 sandipanghos

@jjcoffee Report name must not change to the report ID is already fixed i think because i cannot reproduce it new.expensify.com or stsaging.new.expensify.com .but i will check . can you confirm on this also . currently there is already a function available populateOptimisticReportFormula which do the same as i created for title generation based on policy . so i update the proposal on that if some change require.

in case for the id issue code change not required because already fixed So shall i will remove the change i done to fix for this from proposal but include the change for status properly update in the proposal. Will you consider in such case my proposal and payment

Regarding status correction -

  1. Currently for report title status OPEN in subtitle status is showing Draft in new.expensify.com and staging.new.expensify.com. Should i change it to Open and rest status keep as it is?
  2. Currently when the status is approve the expense don't change their title as per new policy formula updated .So even the report is approved the expense title is showing processing . To avoid this shall change it to after approve status instead of approve status.

sandipanghos avatar Dec 18 '25 06:12 sandipanghos

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 18 '25 16:12 melvin-bot[bot]

@jjcoffee Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 19 '25 23:12 melvin-bot[bot]

Report name must not change to the report ID, the status must update correctly.

Hi @jjcoffee, the expected behavior is unclear to me. What does the status must update correctly means? Does it mean, after changing the defaultTitle it should affect the existing expense report's header? Because, currently it only affects the header of expense reports created after changing the defaultTitle.

rohit9625 avatar Dec 20 '25 14:12 rohit9625

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Dec 20 '25 15:12 mvtglobally