Repository navigation
Conversation
…t workspace Keep the rate (and its violation) when the expense stays on the same workspace, pick the rate with getRateForPolicyChange, and add an optimistic Concierge MODIFIEDEXPENSE for expenses repriced onto the default rate, sending its ID as modifiedExpenseReportActionID. Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
The failing check is unrelated to this PR, so I didn't push a fix. Analysis:
Evidence: This PR's only Next step: Re-run the failed job. |
|
🤖 Web test steps verification results: The PR has no written test steps yet, so I used steps based on the bug in [HOLD App 100555] Expense-Rate violation disappears after moving expense to another report. A same-workspace move kept the "Rate not valid for this workspace" violation. A cross-workspace move repriced the expense with a Concierge message. I skipped the reload checks because reloading can sign out this test session. |
|
🤖 Android test steps verification results: A same-workspace move kept the $0.80/mi rate and the "Rate not valid for this workspace" violation, as the PR intends. The app froze while I was setting up the cross-workspace move, so step 4 couldn't be checked. Step 3 needed an app restart, so it was skipped. The PR has no written test steps yet, so these steps come from the bug in [HOLD App 100555] Expense-Rate violation disappears after moving expense to another report. |
|
@MelvinBot, replace the PR Author checklist with the verified one below: PR author checklist |
|
I replaced the PR description with your verified version. It now includes your Tests, Offline tests, QA Steps, and a fully checked PR Author Checklist. Note: the new description no longer has the warning to merge only after the Auth change for Move expense deploys. Without that Auth change, the optimistic rate change flips back on reload. Let me know if you want that warning added back. |
|
@MelvinBot mark this as ready for review. |
|
@marufsharifi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Marked this PR as ready for review. |
|
@MelvinBot Resolve the conflicts. |
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
@neil-marcellini Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Web test steps verification results: ❌ fail Resolved the conflicts with
view run · no recording available |
|
@MelvinBot, replace the PR Author checklist with the verified one below: PR author checklist |
|
Fixed both regressions and pushed 94c3363:
Added three regression cases; all failed before the fix and pass afterward. Full Jest suite passed: 2,201 suites, 36,845 tests. Lint, typecheck, spelling, and Storybook smoke checks also passed. Web verification remains blocked by a blank browser session. Formatting verification was unavailable: the Prettier script is missing and the targeted Oxfmt command was denied. Message IDs and unrelated review suggestions were left unchanged. view run · no recording available |
…DistanceRateOnWorkspaceChange Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
@MelvinBot merge the main. |
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
@MelvinBot merge the main. |
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
BUG#1:Preconditions:
Steps:
Expected Result: The amount must update in offline mode and the concierge messgae must show the updated amount. Actual Result : The amount does not change in offline mode and the concierge message does not appear PR: RF-pr.mp4main RF-main.mov |
BUG#2:Preconditions:
Steps:
Expected Result:
Actual Result:
PR: bug-two_R26XyUVn.mp4Main: onmain.mov |
|
@MelvinBot find the RCA for the last two regressions reported |
ProposalWhat is the root cause of that problem?BUG 2 is confirmed in the client. BUG 1’s reported unchanged amount/no-message behavior remains unconfirmed. 1. Commuter exclusion, offline move The move skips recalculation whenever Temporary diagnostic tests established:
However, completed online creation normally clears that flag. We have not established that the reported move receives it. Both the strict waypoint guard and commuter-unaware calculation also exist on base 2. Expired fallback preserves the edited $9 Rate selection correctly rejects B’s expired $0.80 rate as an eligible match, then assigns it as the fallback. But the PR subsequently classifies it as matching using only rate, currency, and unit, ignoring why it was selected. That false match disables recalculation and Concierge. A temporary diagnostic reproduced the exact client outcome: expired B rate assigned, effective amount stays $9, expired warning retained, zero Concierge actions. Code evidenceWhat changes do you think we should make in order to solve the problem?
Verification limits: web access was blocked by a blank session. Persistence after reconnect was not independently verified. Temporary diagnostics were removed; the checkout remains clean. |
|
@MelvinBot fix the bug#2 which is confirmed: #105129 (comment) |
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
Fixed BUG 2 and pushed 9e78e9c. Expired fallbacks now recalculate $9 → $8, retain the expired-rate warning, and generate the Concierge message. Valid equivalent rates still preserve the edited amount. BUG 1 was left unchanged. Validation: 38,494 tests passed, plus lint, typecheck, spelling, and Storybook. Manual web verification was blocked by a blank application; the Prettier script remains unavailable. |
|
Hi! We are aware Melvin tester runs are failing. Please if you could update this branch to latest main and re-run it - this should resolve the issue. If not, reach out to me directly. Thanks for your patience! |
| newReport?: OnyxEntry<Report>; | ||
| policy: OnyxEntry<Policy>; | ||
| /** All policies, used to resolve a distance expense's current rate on its source workspace */ | ||
| policies?: OnyxCollection<Policy>; |
There was a problem hiding this comment.
mergeReports (Report/index.ts:9337) also calls getChangeTransactionsReportOnyxData, but MergeReportsProps has no policies, so it gets undefined. On a cross-workspace merge of a distance expense, currentRate ends up undefined → isMatchingRate is false → the expense gets repriced and a Concierge message is added even when the destination has a matching rate. That's the exact behavior this PR fixes elsewhere.
Could we add policies to MergeReportsProps, pull it via useOnyx(ONYXKEYS.COLLECTION.POLICY) in SearchReportsMergeReports.tsx, and pass it through? A test for the cross-workspace merge case would be good too.
There was a problem hiding this comment.
The missing policies argument is real, but the cross-workspace merge described here is not a supported user flow:
canMergeReportsrejects different workspace IDs.- The confirmation screen checks that eligibility and returns before calling
mergeReports. - Supported same-workspace merges take the same-workspace branch and skip rate selection, so missing source-rate lookup data does not cause the proposed repricing there.
I ran the existing merge-eligibility tests: 54 passed, including rejection of different-workspace reports. No code change is needed for this comment; forwarding additional policy data for a hypothetical cross-workspace merge would be outside the currently supported behavior.
|
@MelvinBot validate this comment: #105129 (comment), if it isn't out of scope of this pr, address it. |
|
Reviewed the report-merge feedback and replied in-thread. No code change is needed: cross-workspace report merges are explicitly blocked, and supported same-workspace merges skip rate selection, so the described repricing path is unreachable. Validation: all 54 merge-eligibility tests passed. |
|
The comment identifies a missing argument, but its failure scenario is outside supported behavior: cross-workspace report merges are explicitly rejected. Supported same-workspace merges skip rate selection, so they cannot trigger the described repricing. No code change is needed. The 54 merge-eligibility tests passed on this unchanged PR head. |
|
@MelvinBot merge the main. |
Co-authored-by: Maruf Sharifi <marufsharifi@users.noreply.github.com>
|
Claude posting on behalf of Matt: Closing this PR. Work on the linked issue continues in a new PR. Use this one as a reference. |










Explanation of Change
Previously, moving a distance expense to another report could incorrectly replace its rate, even within the same workspace, and clear existing rate violations.
This PR fixes that behavior by:
Fixed Issues
$ #100558
PROPOSAL: #100558 (comment)
Tests
Preconditions:
Have just one workspace with the distance rate enable
have a distance of 0.80 miles
Test 1 — Move expense within the same workspace
Test 2 — Preserve an existing rate violation
Test 3 — Move an unreported expense within its original workspace
Verify that no errors appear in the JS console
Offline tests
Test — Move expense within the same workspace while offline
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.AI Tests
Main merge verification (2026-11-12):
f3538e5728146439c4decfbad05907b2f079f826without conflicts or handwritten source changes.Expired fallback BUG 2 verification (2026-11-10):
Manual web verification
🤖 Web test steps verification results: ❌ fail
Runtime blocked verification on dev NewDot web; this is not a confirmed PR regression. No active appduct session was available, and both browser snapshots returned zero nodes on a blank page.

Expired B rate: offline expense move assigns fallback, recalculates $9 to $8, retains warning, and creates Concierge adjustment.
Not verified manually: the blank application prevented fixture setup and execution.Eligible B rate control preserves manually edited $9 without a Concierge message.
Not verified manually due to the same runtime blocker.Main merge verification (2026-11-10):
cc11655210b92be8e2b4a13feff27d20e3cd6674without conflicts or handwritten source changes.Main merge verification (2026-11-09):
5ebbde7d7cca4d372921e1ce0350b6962cf0ccedwithout conflicts or handwritten source changes.CI typecheck fix verification (2026-11-06):
Regression fix verification (2026-11-06):
Web verification blocker
Conflict resolution verification:
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari