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
Expense - Distance expense can still be created after selecting "Out of date" rate. #95108
Version Number: 9.4.26-0 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:#93555 Email or phone of affected tester (no customers):applausetester+ib0024@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Money Requests
Action Performed:
Prerequisite: Use an expensifail account.
Prerequisite 2: User is owner of a workspace with "Distance Rates" enabled.
Prerequisite 3: Two custom distance rates created. (Rate A: 0,67/mi - Valid Jan 1 - Dec 31 2025 - Rate B: 0,70/MI - Valid Jan1 - Dec 31 2026)
Open the staging.new.expensify.com wesbite.
Navigate to workspace chat.
Start creating a new map distance expense and select "Jun 15, 2025" as date.
Note that "Rate A" is automatically selected.
After rate is auto selected, change it manually to "Rate B"
Note that "Out of rate" error appears, but "Create" button is not disabled and expense can still be created.
Expected Result:
When an "Out of date" rate is selected while creating distance expense, user shouldn´t be able to submit expense as "Create" button should be blocked.
Actual Result:
When an "Out of date" rate is selected while creating distance expense, user is still able to submit the expense as "Create" button is not blocked.
👋 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.
TL;DR: The "out of date" rate error is display-only. It's computed locally inside RateField to draw the red brick road, but it is never wired into the confirmation screen's submit-gating logic, so the Create button stays enabled and the expense goes through.
What is the root cause of that problem?
PR #93555 added the customUnitRateOutOfDateRange violation and its display, but did not connect it to the create/confirm gating path.
On the confirmation screen the Create/Submit button has no violation-driven isDisabled — it's only gated at press-time by useConfirmationValidation.validate(). That function checks amount, merchant, category, tax, per-diem, etc., but has no branch for an out-of-date distance rate, so it returns {errorKey: null} and onConfirm fires.
Meanwhile the "Out of rate" error the user sees is computed locally insideRateField.tsx:72 via DistanceRequestUtils.isCustomUnitRateOutOfDateRange(...) and only drives the brickRoadIndicator / errorText. That isRateOutOfDateRange boolean is never lifted up to the parent or passed to validate(). The display path and the gating path never meet.
Evidence / data flow
Select out-of-date rate → RateField computes isRateOutOfDateRange = true → shows red dot + "Out of rate" text (display only) → tap Create → confirmAction runs validate() → no out-of-date branch → returns {errorKey: null} → onConfirm fires → expense created.
This also explains why the PR's own test steps were internally contradictory: Test 1 ("Submit / Create is not blocked") matches the actual code, while Test 5 ("submit blocked") describes behavior that was never implemented on the create flow.
What changes do you think we should make in order to solve the problem?
Add a blocking check to validate() in useConfirmationValidation.ts, reusing the same predicateRateField already uses so the field error and button gating stay in sync. Inside the iouType !== CONST.IOU.TYPE.PAY block, alongside the existing distance checks, when isDistanceRequest and DistanceRequestUtils.isCustomUnitRateOutOfDateRange({customUnitRateID, policy, expenseDate}) is true, return an errorKey so onConfirm is short-circuited. The hook already has transaction (source of customUnitRateID and the expense date via getCreated) and policy.
What alternative solutions did you explore? (Optional)
Lifting isRateOutOfDateRange out of RateField and passing an isDisabled into the footer button. This works but fights the codebase's established pattern (the confirm button is gated by press-time validate(), not a disabled prop), so it's the larger/less consistent option.
⚠️ One product decision to confirm before implementing
customUnitRateOutOfDateRange is defined as a WARNING-type violation (RateField.tsx:78), not an error. There's a genuine question of whether a warning-severity violation should hard-block creation. This DeployBlocker + the PR's Test 5 say it should block on create; the current code + Test 1 say it shouldn't. The fix is straightforward once that intent is confirmed — but it should be confirmed so the copy/severity match.
Confidence: High — root cause is a verifiable code-path gap (confirmed in the checked-out source); no production logs needed.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/95108) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Activity
applause-bot commentedon Jul 2, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/e28557fa039df8f0b1a4edeea37e9229e6e2f352da74aeb659bd2c710e9fe163
melvin-bot commentedon Jul 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #93555
melvin-bot commentedon Jul 2, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 2, 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:
MelvinBot commentedon Jul 2, 2026
Proposal
TL;DR: The "out of date" rate error is display-only. It's computed locally inside
RateFieldto draw the red brick road, but it is never wired into the confirmation screen's submit-gating logic, so the Create button stays enabled and the expense goes through.What is the root cause of that problem?
PR #93555 added the
customUnitRateOutOfDateRangeviolation and its display, but did not connect it to the create/confirm gating path.On the confirmation screen the Create/Submit button has no violation-driven
isDisabled— it's only gated at press-time byuseConfirmationValidation.validate(). That function checks amount, merchant, category, tax, per-diem, etc., but has no branch for an out-of-date distance rate, so it returns{errorKey: null}andonConfirmfires.Meanwhile the "Out of rate" error the user sees is computed locally inside
RateField.tsx:72viaDistanceRequestUtils.isCustomUnitRateOutOfDateRange(...)and only drives thebrickRoadIndicator/errorText. ThatisRateOutOfDateRangeboolean is never lifted up to the parent or passed tovalidate(). The display path and the gating path never meet.Evidence / data flow
Select out-of-date rate →
RateFieldcomputesisRateOutOfDateRange = true→ shows red dot + "Out of rate" text (display only) → tap Create →confirmActionrunsvalidate()→ no out-of-date branch → returns{errorKey: null}→onConfirmfires → expense created.isDisabledtied to violations:ConfirmationFooterContent.tsx:129-139validate()has nocustomUnitRateOutOfDateRangecase:useConfirmationValidation.ts:278-305isCustomUnitRateOutOfDateRangeThis also explains why the PR's own test steps were internally contradictory: Test 1 ("Submit / Create is not blocked") matches the actual code, while Test 5 ("submit blocked") describes behavior that was never implemented on the create flow.
What changes do you think we should make in order to solve the problem?
Add a blocking check to
validate()inuseConfirmationValidation.ts, reusing the same predicateRateFieldalready uses so the field error and button gating stay in sync. Inside theiouType !== CONST.IOU.TYPE.PAYblock, alongside the existing distance checks, whenisDistanceRequestandDistanceRequestUtils.isCustomUnitRateOutOfDateRange({customUnitRateID, policy, expenseDate})is true, return anerrorKeysoonConfirmis short-circuited. The hook already hastransaction(source ofcustomUnitRateIDand the expense date viagetCreated) andpolicy.What alternative solutions did you explore? (Optional)
Lifting
isRateOutOfDateRangeout ofRateFieldand passing anisDisabledinto the footer button. This works but fights the codebase's established pattern (the confirm button is gated by press-timevalidate(), not a disabled prop), so it's the larger/less consistent option.customUnitRateOutOfDateRangeis defined as aWARNING-type violation (RateField.tsx:78), not an error. There's a genuine question of whether a warning-severity violation should hard-block creation. This DeployBlocker + the PR's Test 5 say it should block on create; the current code + Test 1 say it shouldn't. The fix is straightforward once that intent is confirmed — but it should be confirmed so the copy/severity match.Confidence: High — root cause is a verifiable code-path gap (confirmed in the checked-out source); no production logs needed.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95108)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
thelullabyy commentedon Jul 2, 2026
I think it is expected behavior
cc @rlinoz for double check
rlinoz commentedon Jul 2, 2026
Yes, it is the expected behavior, closing.