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
[Due for payment 2025-11-03] [$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense #72571
Version Number: 9.2.30-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#62787 Email or phone of affected tester (no customers):josdnijoijsdojsoj@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Delayed submissions are disabled in Workflows settings.
Go to staging.new.expensify.com
Go to workspace chat.
Create a distance expense in workspace chat.
Open the expense report.
Click Submit.
Click More > Reject.
Enter reason and click Reject expense.
Expected Result:
LHN will show the distance rate after rejecting the distance expense.
Actual Result:
LHN shows "Pending..." as distance rate after rejecting the distance expense.
It only shows the rate after opening the expense thread.
Please re-state the problem that we are trying to solve in this issue.
Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense
What is the root cause of that problem?
When a report is rejected, we delete the report. However, we need policyID to get the transaction rate.
The condition below, from getMerchant, will be true because the rate is null and policy. So iou.fieldPending is returned by getDistanceMerchant(). In turn, getMerchant() returns iou.fieldPending and the transaction name will end with "Pending...".
What changes do you think we should make in order to solve the problem?
Consider fixing rejectMoneyRequest() so getMerchant can find the policyID by setting the transaction's reportID to the self-dm or the rejectedReportID.
What alternative solutions did you explore? (Optional)
Alternative 1
Instead of deleting the transaction report, we can remove reportID or any other attribute to make the report inactive. So we can link the transaction to the report and, in turn, to the policy.
Alternative 2
Return a default mileage rate from the personal policy, since getDefaultMileageRate will return undefined when policy is none, and the transaction's rate field is not pending.
changed the title [-]Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/-][+][$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/+]on Oct 15, 2025
⚠️@apeyada Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
changed the title [-][$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/-][+][Due for payment 2025-11-03] [$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/+]on Oct 27, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.38-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@situchan@VictoriaExpensify 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]
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Delayed submissions are disabled in Workflows settings.
Test:
Go to workspace chat.
Create a distance expense in workspace chat.
Open the expense report.
Click Submit.
Click More > Reject.
Enter reason and click Reject expense.
Verify that expense report in LHN shows the distance rate after rejecting the distance expense.
Activity
melvin-bot commentedon Oct 14, 2025
Triggered auto assignment to @VictoriaExpensify (
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.Tony-MK commentedon Oct 14, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense
What is the root cause of that problem?
When a report is rejected, we delete the report. However, we need
policyIDto get the transaction rate.The condition below, from
getMerchant, will betruebecause the rate is null andpolicy. Soiou.fieldPendingis returned bygetDistanceMerchant(). In turn,getMerchant()returnsiou.fieldPendingand the transaction name will end with"Pending...".App/src/libs/TransactionUtils/index.ts
Lines 823 to 829 in b086be9
What changes do you think we should make in order to solve the problem?
Consider fixing
rejectMoneyRequest()sogetMerchantcan find thepolicyIDby setting the transaction'sreportIDto the self-dm or therejectedReportID.What alternative solutions did you explore? (Optional)
Alternative 1
Instead of deleting the transaction report, we can remove
reportIDor any other attribute to make the report inactive. So we can link the transaction to the report and, in turn, to the policy.Alternative 2
Return a default mileage rate from the personal policy, since
getDefaultMileageRatewill returnundefinedwhenpolicyis none, and the transaction's rate field is not pending.[-]Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/-][+][$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/+]melvin-bot commentedon Oct 15, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021978302252049562990
melvin-bot commentedon Oct 15, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (
External)apeyada commentedon Oct 15, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
LHN shows "Pending..." as distance rate after rejecting the distance expense
What is the root cause of that problem?
We show
xxx for merchantin LHN. Here's merchant getting logic:App/src/libs/TransactionUtils/index.ts
Lines 822 to 832 in b086be9
When reject distance expense, we delete report but we don't unlink that report from transaction, so
transaction.reportIDstill remains.So
App/src/libs/TransactionUtils/index.ts
Line 826 in b086be9
Finally calls
DistanceRequestUtils.getDistanceMerchantwhich returnsPending....What changes do you think we should make in order to solve the problem?
When delete report, unlink that report from transaction optimistically by setting
transaction.reportIDto null or UNREPORTED_REPORT_ID (aka. "0").Here's the right place to add:
App/src/libs/actions/IOU.ts
Lines 12642 to 12647 in e95b3e6
We can also add successData and failureData.
What alternative solutions did you explore? (Optional)
App/src/libs/TransactionUtils/index.ts
Line 826 in b086be9
Add
policy &&condition heregithub-actions commentedon Oct 15, 2025
situchan commentedon Oct 15, 2025
Screen.Recording.2025-10-15.at.8.42.38.PM.mov
I noticed that
reportIDoftransactionchanges to "0" only after opening the rejected expense report from LHN.situchan commentedon Oct 15, 2025
@apeyada's proposal looks good to me.
🎀 👀 🎀 C+ reviewed
14 remaining items
[-][$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/-][+][Due for payment 2025-11-03] [$250] Expense - LHN shows "Pending..." as distance rate after rejecting the distance expense[/+]melvin-bot commentedon Oct 27, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 27, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.38-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-11-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 27, 2025
@situchan @VictoriaExpensify 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]
situchan commentedon Nov 3, 2025
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/62787/files#r2485264559
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Delayed submissions are disabled in Workflows settings.
Test:
Do we agree 👍 or 👎
VictoriaExpensify commentedon Nov 3, 2025
Issue raised to have regression test added to BrowserStack https://github.com/Expensify/Expensify/issues/564205
VictoriaExpensify commentedon Nov 3, 2025
Payment summary:
C: @apeyada - Offer has been sent to you through UW - please accept so I can make payment
C+: @situchan - Paid $250 via Upwork
VictoriaExpensify commentedon Nov 6, 2025
Updated Payment summary:
C: @apeyada - Paid $250 via Upwork
C+: @situchan - Paid $250 via Upwork