Repository navigation
Description
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.1.45-21
Reproducible in staging?: Y
Reproducible in production?: Y
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: @MonilBhavsar
Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
- Create n workspace and set submission to Manual
- Invite an employee to the workspace
- As an employee, create a report and add an expense to it
- Click to open the report details
- Observe the last message in Report chat.
Expected Result:
LHN should show “no activity.”
Actual Result:
It says "submitted", but report is still in "Open" state
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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
Screen.Recording.2025-05-16.at.7.25.05.PM.mov
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021924596788231412189
- Upwork Job ID: 1924596788231412189
- Last Price Increase: 2025-05-26


Activity
melvin-bot commentedon May 19, 2025
Triggered auto assignment to @twisterdotcom (
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.ganzz4 commentedon May 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a report is in the "Open" state (not yet submitted), but contains an IOU (expense) action or a SUBMITTED action, the Left Hand Navigation (LHN) incorrectly displays a "submitted ..." message. Instead, it should display "no activity yet" until the report is actually submitted.
What is the root cause of that problem?
The function
getLastMessageTextForReport, which generates the preview message in the Left Hand Navigation (LHN), determines the message based only on the last action type (e.g., IOU or SUBMITTED), without checking the report’s actual state.As a result, it can display a misleading "submitted ..." message even if the report is still in the "Open" state and hasn't been submitted. This logic appears in two places:
App/src/libs/OptionsListUtils.ts
Lines 735 to 737 in 16a4d7b
App/src/libs/OptionsListUtils.ts
Lines 775 to 785 in 16a4d7b
To fix this, the function should verify the report’s state and only display "submitted ..." if it’s truly submitted. Otherwise, it should show "no activity yet" to reflect the correct status.
What changes do you think we should make in order to solve the problem?
Generalized fix:
In both code sections above, add a check for the report's state.
If the report is still open (
stateNum === CONST.REPORT.STATE_NUM.OPEN), display "no activity yet" instead of "submitted ...".Example fix (applies to both places):
By adding a single state check in both relevant branches of
getLastMessageTextForReport, we ensure the LHN always reflects the true report status.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
N/A
ganzz4 commentedon May 19, 2025
I've recorded a quick demo video showing the fix in action:
Result.mp4
melvin-bot commentedon May 19, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021924596788231412189
[-]Incorrect report action in the LHN[/-][+][$250] Incorrect report action in the LHN[/+]melvin-bot commentedon May 19, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)dmkt9 commentedon May 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
It says "submitted", but report is still in "Open" state
What is the root cause of that problem?
The text preview for LHN report chat is retrieved from the following functions and passed into
OptionRowLHNData:getLastMessageTextForReport:App/src/components/LHNOptionsList/LHNOptionsList.tsx
Line 208 in e65db2e
getReportPreviewMessage:App/src/libs/OptionsListUtils.ts
Line 735 in e65db2e
And in the function
getReportPreviewMessage, the returned value comes from the following logic:App/src/libs/ReportUtils.ts
Lines 4297 to 4304 in e65db2e
This logic does not check whether the report is in manual submit mode.
What changes do you think we should make in order to solve the problem?
isSubmitActionfunction at this point:App/src/libs/ReportUtils.ts
Line 4297 in e65db2e
App/src/libs/ReportPrimaryActionUtils.ts
Line 56 in e65db2e
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
N/A
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.
bernhardoj commentedon May 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
LHN last message shows submitted message when the report is still open.
What is the root cause of that problem?
The message is coming from here.
App/src/libs/OptionsListUtils.ts
Lines 735 to 737 in a95171a
App/src/libs/ReportUtils.ts
Lines 4296 to 4303 in a95171a
It gets the last action (which is the IOU) and then gets the message from
getReportPreviewMessage. Before #39483, the message would berequested $x.x for {comment}. Before #48139, the last action was empty, and "No activity yet" was shown.The last action is calculated here. For a one-transaction report, the report actions are combined, just like we do on the report screen, to filter out the IOU action. However, #48139 changes it so that no IOU actions are filtered, so basically, the combine logic does nothing.
App/src/libs/OptionsListUtils.ts
Lines 403 to 414 in a95171a
It's to fix #47843, where the 0.0 amount is shown as the last message while the receipt is scanning, because when the last action is empty, it falls back to the
lastMessageTextfirst.What changes do you think we should make in order to solve the problem?
If we want to show "No activity yet" for one-transaction report, then we should filter out the IOU action by removing the last param.
App/src/libs/OptionsListUtils.ts
Line 406 in a95171a
To handle 0.0 amount is shown as the last message, we shouldn't set the last message optimistically since BE doesn't set either.
App/src/libs/actions/IOU.ts
Lines 1335 to 1336 in a95171a
Last, we need to change the
??here to||. For the expense report, the welcome message is an empty string, so the "No activity yet" fallback is never used. If we don't update this, theformattedLoginwill be shown. If we update this, then we can remove theformattedLoginfallback.App/src/libs/SidebarUtils.ts
Lines 680 to 687 in a95171a
The above solution will handle for one-transaction report. If we create 2 money requests, then the last message will still show
submitted $x.x for {comment}since the last action is IOU. If we want to use the old message (requested $x.x for {comment}), then we need to re-add the translation back and use it here.App/src/libs/ReportUtils.ts
Line 4302 in a95171a
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can test
SidebarUtils.getOptionDataand assert thealternateTextis "No activity yet" for empty one-transaction report.melvin-bot commentedon May 23, 2025
@abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!
36 remaining items
melvin-bot commentedon Jun 16, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.66-5 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-06-23. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 16, 2025
@mananjadhav @twisterdotcom @mananjadhav 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]
melvin-bot commentedon Jun 23, 2025
Payment Summary
Upwork Job
BugZero Checklist (@twisterdotcom)
twisterdotcom commentedon Jun 23, 2025
Payment Summary:
twisterdotcom commentedon Jun 23, 2025
Could we get a checklist here please @mananjadhav?
mananjadhav commentedon Jun 23, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: fix: LHN preview for expense report shows 0.00 when there is only one scan expense #48139 (comment)
[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: NA
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/516817
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
mananjadhav commentedon Jun 23, 2025
@twisterdotcom Done.
bernhardoj commentedon Jun 23, 2025
Requested in ND.
garrettmknight commentedon Jun 27, 2025
$250 approved for @mananjadhav
JmillsExpensify commentedon Jul 2, 2025
$250 approved for @bernhardoj