Skip to content

[Due for payment 2025-11-17] [$250] Report status badge translation is not changing until page refresh #74054

Closed

Description

@m-natarajan

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.2.42-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @mukhrr
Slack conversation (hyperlinked to channel name): #Open Source

Action Performed:

[user A] Go to IOU chat
[user A] Create an expense
[user B] Mark as Paid that expense
[user B] Go to Preference and change language
[user B] Back to paid expense chat

Expected Result:

You see Paid status badge in latest changed language

Actual Result:

You see Paid status in preview in previous language

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
REC-20251102070510.mp4
Recording.1855.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021985189430774152987
  • Upwork Job ID: 1985189430774152987
  • Last Price Increase: 2025-11-03
  • Automatic offers:
    • samranahm | Contributor | 109335336
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 2, 2025
  2. melvin-bot commented on Nov 2, 2025

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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.

  3. melvin-bot commented on Nov 2, 2025

    @melvin-bot

    Triggered auto assignment to @mollfpr (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Nov 2, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. samarroy84 commented on Nov 2, 2025

    @samarroy84
    Contributor

    Proposal

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

    Report status badge translation is not changing until page refresh

    What is the root cause of that problem?

    We’re memoizing reportStatus and reportStatusColorStyle here:

    const reportStatus = useMemo(
    () => getReportStatusTranslation(iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
    [action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum],
    );
    const reportStatusColorStyle = useMemo(
    () => getReportStatusColorStyle(theme, iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
    [action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, theme],
    );

    But translate is not added to dependencies list

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

    • Pass translate to getReportStatusTranslation as parameter
    • Replace translateLocal with translate

      App/src/libs/ReportUtils.ts

      Lines 12251 to 12263 in 515655a

      return translateLocal('common.draft');
      }
      if (stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && statusNum === CONST.REPORT.STATUS_NUM.SUBMITTED) {
      // eslint-disable-next-line @typescript-eslint/no-deprecated
      return translateLocal('common.outstanding');
      }
      if (stateNum === CONST.REPORT.STATE_NUM.APPROVED && statusNum === CONST.REPORT.STATUS_NUM.CLOSED) {
      // eslint-disable-next-line @typescript-eslint/no-deprecated
      return translateLocal('common.done');
      }
      if (stateNum === CONST.REPORT.STATE_NUM.APPROVED && statusNum === CONST.REPORT.STATUS_NUM.APPROVED) {
      // eslint-disable-next-line @typescript-eslint/no-deprecated
      return translateLocal('iou.approved');

    What alternative solutions did you explore? (Optional)

  7. samranahm commented on Nov 2, 2025

    @samranahm
    Contributor

    Proposal

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

    Report status badge translation is not changing until page refresh

    What is the root cause of that problem?

    We get the badge text from getReportStatusTranslation and color from getReportStatusColorStyle and use useMemo to memorize it, but as soon we change the local the reportStatus does not update leading with local leading to this bug

    const reportStatus = useMemo(
    () => getReportStatusTranslation(iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
    [action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum],
    );

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

    We should add the translate dep in deps array of reportStatus only and it's not required for reportStatusColorStyle since it will remain same.

    const reportStatus = useMemo(
        () => getReportStatusTranslation(iouReport?.stateNum ?? action?.childStateNum, iouReport?.statusNum ?? action?.childStatusNum),
        [action?.childStateNum, action?.childStatusNum, iouReport?.stateNum, iouReport?.statusNum, translate],
    );

    Like we have through out in our App

    }, [years, searchText, translate]);

    [dobInputID, stepFields, translate],

    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.

  8. 24 remaining items

  9. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Nov 10, 2025
  10. changed the title [-][$250] Report status badge translation is not changing until page refresh[/-] [+][Due for payment 2025-11-17] [$250] Report status badge translation is not changing until page refresh[/+] on Nov 10, 2025
  11. melvin-bot commented on Nov 10, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  12. melvin-bot commented on Nov 10, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.47-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-11-17. 🎊

    For reference, here are some details about the assignees on this issue:

  13. melvin-bot commented on Nov 10, 2025

    @melvin-bot

    @hungvu193 @trjExpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. hungvu193 commented on Nov 14, 2025

    @hungvu193
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/66260/files#r2526919788

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Test:

    1. [user A] Go to IOU chat
    2. [user A] Create an expense
    3. [user B] Mark as Paid that expense
    4. [user B] Go to Preference and change language
    5. [user B] Back to paid expense chat
    6. [user B] Verify that the status badge is translated to the selected language

    Do we agree 👍 or 👎

  15. trjExpensify commented on Nov 17, 2025

    @trjExpensify
    Contributor

    I don't think we need a standalone regression test for this one, so I'll forgo adding it.

    Payment summary as follows:

    All done, closing. Thanks!

  16. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions