Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Held expense - LHN preview shows inconsistent system message when expense is held #58491

Open
8 tasks done
vincdargento opened this issue Mar 14, 2025 · 2 comments
Open
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Overdue

Comments

@vincdargento
Copy link

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: 9.1.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
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): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit two expenses to the workspace chat.
  4. Go to transaction thread of any expense.
  5. Click on the report header > Hold.
  6. Enter reason and save it.
  7. Dismiss RHP and education modal if needed.
  8. Delete the hold reason in the transaction thread.
  9. Note that the system message in transaction thread is "held this expense", but LHN preview shows "held this expense with the comment:".
  10. Click on the header subtitle and go back to transaction thread.
  11. Now LHN preview shows "held this money request, saying x".

Expected Result:

In Step 9 and 11, LHN preview for hold expense system message should be the same as transaction thread.

Actual Result:

In Step 9, the system message in transaction thread is "held this expense", but LHN preview shows "held this expense with the comment:".
In Step 11, after refreshing the page, LHN preview shows "held this money request, saying x".

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

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

@etCoderDysto
Copy link
Contributor

Proposal

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

Held expense - LHN preview shows inconsistent system message when expense is held

What is the root cause of that problem?

We use optionItem.alternateText to display LHN preview message. And it is calculated by getOptionData function. In getOptionData, we are not handling HOLD action type as we are doing for PureReportActionItem. And hold action is handled in the else condition by default below

} else {
result.alternateText =
lastMessageTextFromReport.length > 0
? formatReportLastMessageText(Parser.htmlToText(lastMessageText))
: getLastVisibleMessage(report.reportID, result.isAllowedToComment, {}, lastAction)?.lastMessageText;

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

We should handle HOLD action in the same way we are handling them in PureReportActionItem. We should do the same for UNHOLD action if the same problem happens for unhold action too.

 else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {
            result.alternateText = translateLocal('iou.heldExpense');
        }

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Add test that asserts getOptionData returns the expected value when a report's last action is hold here.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Overdue
Projects
None yet
Development

No branches or pull requests

3 participants