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
[$250] Distance - "Please fix the distance rate error" appears when approved split cannot be edited #83564
Version Number: 9.3.26-4 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#82257 Email or phone of affected tester (no customers):jsdoijsoidnjoisjdsoi@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Distance rates are enabled.
Workspace has two distance rates.
Go to staging.new.expensify.com
Go to workspace chat.
Create a manual distance expense.
Open the expense.
Click More > Split > Save.
Open any split.
Click Report > Create report.
On the current report, click Submit and Approve.
Go to workspace settings > Distance rates.
Delete the distance rate used in Step 3.
Open the expense report containing split in the new report (from Step 7).
Click Amount.
Click on the highlighted row.
Click Rate > select other rate > Save.
Click Save.
Expected Result:
User should be able to save the split because user has changed the split rate to valid rate in Step 14.
Actual Result:
"Please fix the distance rate error" shows up, but user cannot edit the approved split (from 8).
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence) Related Issues: None
Recommendation: REVERT
PR #82257 introduced validation logic that prevents saving distance splits with invalid rate IDs. However, this validation does not account for approved splits that cannot be edited. When a distance rate is deleted after a split is approved, users are trapped in an impossible state where they cannot save changes even after selecting a valid rate.
Labels: Keeping DeployBlockerCash label (frontend bug in App repo)
📋 Detailed Analysis
Evidence
PR #82257 added distance rate validation to SplitExpensePage.tsx (lines 152-166 and 204-212 in the current code):
The issue is reproducible on staging but N/A for production (new feature)
Root Cause
The validation logic checks if the rate ID exists in the policy's current rates, but it does not consider that:
After Step 8 (Submit and Approve), the split expense report becomes approved
Approved splits cannot be edited (per isSplitAction logic in ReportSecondaryActionUtils.ts lines 137-139, which blocks editing when report.statusNum >= CONST.REPORT.STATUS_NUM.CLOSED)
When the user tries to change the rate in Step 14, they are editing an approved split
The validation runs before save and blocks with "Please fix the distance rate error"
The user cannot actually fix it because the split is approved and cannot be saved
This creates an impossible user state where the error message says to fix the rate, but the system prevents saving any changes.
Please re-state the problem that we are trying to solve in this issue.
When a distance expense is split and one of the splits is moved to a report that gets approved, then the original distance rate is deleted from the workspace, the user is blocked from saving any changes to the remaining editable splits. The error "Please fix the distance rate error" appears, but the user cannot fix it because the approved split (which still references the deleted rate) cannot be edited.
What is the root cause of that problem?
The distance rate validation loop in SplitExpensePage.tsx (lines 152-166) checks all split expenses unconditionally — it does not filter out non-editable (approved/settled/closed) splits:
letisUnitRateIDOutOfPolicy=false;for(constsplitExpenseofsplitExpenses){// No editability check — iterates ALL splits
...
if(!rates[currentRateID]||!rate){
isUnitRateIDOutOfPolicy =true;}}
When isUnitRateIDOutOfPolicy is true, the save is blocked at lines 204-212 with a modal error.
This creates a deadlock: the validation fails because an approved split references a deleted rate, but the user cannot fix the approved split because it's non-editable.
What changes do you think we should make in order to solve the problem?
Modify the validation loop in SplitExpensePage.tsx (lines 152-166) to skip non-editable splits when checking for invalid distance rates. The loop should compute the editability of each split (using the same isSplitAction logic already used at line 357-359) and only set isUnitRateIDOutOfPolicy = true for splits the user can actually edit.
This way, if an approved split has a deleted rate but the user has already fixed all editable splits, the save will proceed without being blocked by issues the user cannot resolve.
What alternative solutions did you explore? (Optional)
Auto-update the rate on non-editable splits during save — This would silently change data on approved transactions, which could cause accounting issues.
Show a warning instead of blocking — This would let the user save but might propagate invalid rate data, so filtering the validation to only editable splits is cleaner.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
This issue also occurs on the latest production build v9.3.25-13, so I think we can separate this into a new issue cause saved new expense with invalid rate also show error
Activity
melvin-bot commentedon Feb 26, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82257
melvin-bot commentedon Feb 26, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to @laurenreidexpensify (
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.github-actions commentedon Feb 26, 2026
👋 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:
OSBotify commentedon Feb 26, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence)
Related Issues: None
Recommendation: REVERT
PR #82257 introduced validation logic that prevents saving distance splits with invalid rate IDs. However, this validation does not account for approved splits that cannot be edited. When a distance rate is deleted after a split is approved, users are trapped in an impossible state where they cannot save changes even after selecting a valid rate.
Labels: Keeping DeployBlockerCash label (frontend bug in App repo)
📋 Detailed Analysis
Evidence
PR #82257 added distance rate validation to
SplitExpensePage.tsx(lines 152-166 and 204-212 in the current code):And blocks saving in the
onSaveSplitExpensehandler:Verification
SplitExpensePage.tsxRoot Cause
The validation logic checks if the rate ID exists in the policy's current rates, but it does not consider that:
isSplitActionlogic inReportSecondaryActionUtils.tslines 137-139, which blocks editing whenreport.statusNum >= CONST.REPORT.STATUS_NUM.CLOSED)This creates an impossible user state where the error message says to fix the rate, but the system prevents saving any changes.
MelvinBot commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a distance expense is split and one of the splits is moved to a report that gets approved, then the original distance rate is deleted from the workspace, the user is blocked from saving any changes to the remaining editable splits. The error "Please fix the distance rate error" appears, but the user cannot fix it because the approved split (which still references the deleted rate) cannot be edited.
What is the root cause of that problem?
The distance rate validation loop in
SplitExpensePage.tsx(lines 152-166) checks all split expenses unconditionally — it does not filter out non-editable (approved/settled/closed) splits:When
isUnitRateIDOutOfPolicyistrue, the save is blocked at lines 204-212 with a modal error.Meanwhile, the editability check at lines 357-359 uses
isSplitAction()fromReportSecondaryActionUtils.ts(line 137-139), which returnsfalsefor reports withstatusNum >= CLOSED(includes APPROVED=3). Non-editable splits show a "cannot be edited" modal at lines 456-465.This creates a deadlock: the validation fails because an approved split references a deleted rate, but the user cannot fix the approved split because it's non-editable.
What changes do you think we should make in order to solve the problem?
Modify the validation loop in
SplitExpensePage.tsx(lines 152-166) to skip non-editable splits when checking for invalid distance rates. The loop should compute the editability of each split (using the sameisSplitActionlogic already used at line 357-359) and only setisUnitRateIDOutOfPolicy = truefor splits the user can actually edit.This way, if an approved split has a deleted rate but the user has already fixed all editable splits, the save will proceed without being blocked by issues the user cannot resolve.
What alternative solutions did you explore? (Optional)
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.5 remaining items
melvin-bot commentedon Feb 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026997105019388034
ZhenjaHorbach commentedon Feb 26, 2026
I will create a fix soon
suneox commentedon Feb 26, 2026
This issue also occurs on the latest production build
v9.3.25-13, so I think we can separate this into a new issue cause saved new expense with invalid rate also show error83564.1.mp4
m-natarajan commentedon Feb 26, 2026
Able to save the split but Rate not valid for this workspace error message displayed, Windows 10/ Chrome, v9.3.26-6
repro.-.issue.83564.mp4
lakchote commentedon Mar 17, 2026
Issue not reproducible:
Screen.Recording.2026-03-17.at.07.39.17.mov