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.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: Exploratory - Significant User Experience Deterioration
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 rates created. Rate A, only has a start date (Jan 1, 2025) and Rate B, only has an end date (Dec 31, 2026)
- Open the staging.new.expensify.com website.
- Navigate to workspace chat.
- Start creating a map distance expense with date on December 2024.
- After date is selected, change rate to "Rate A"
- Note that a "Rate is only valid from Jan 1, 2025" error appears.
- Create expense.
- Note that the same error is visible on expense preview and is still visible when opening expense.
- Delete the expense.
- Start creating a new map distance expense with any date on 2027.
- Manually select "Rate B"
- Note that a "Rate is only valid until Dec 31, 2025" error appears.
- Create the expense.
- Note that preview shows "Review Required" instead of showing the same error.
- Open the expense.
- Note that "Rate is only valid until..." error is displayed on report.
Expected Result:
Error displayed inside report after selecting an expired rate, should be also visible on report preview.
Actual Result:
"Rate only valid until..." error is displayed on report, but only "Review Required" error is displayed on preview instead of the same message being visible.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7196961_1782940620397.Invalid_5.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7196961
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
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/5e9f23ac940adf35af17ce94aae72797941860696d75128c1126d2d9da63ffb2
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
Problem
The out-of-date-range rate error shows correctly inside the opened expense/report, but the transaction preview falls back to the generic "Review Required" for a rate that only has an end date — while a rate with only a start date shows the specific message just fine. Introduced by #93555 (deploy blocker).
Root Cause
The preview truncates any single rate-date warning whose translated text is longer than 40 characters. It's a message-length threshold bug, not a violation-count or wrong-data bug.
In
getViolationTranslatePath, the preview returnsviolations.reviewRequiredwheneverviolationMessage.length > CONST.REPORT_VIOLATIONS.RBR_MESSAGE_MAX_CHARACTERS_FOR_PREVIEW, which is40. Both cases have exactly one violation (thecustomUnitRateOutOfDateRangewarning), so the only differing term is message length — and the two variants land on opposite sides of 40:Rate is only valid from January 1, 2025→ 39 chars ≤ 40 → shows the message ✅Rate is only valid until December 31, 2026→ 42 chars > 40 → collapses to "Review Required" ❌The opened report doesn't apply this preview-only length gate, which is why the specific message appears there in both cases. (The "Dec 31, 2025" in the report is a reporter transcription artifact — dates render with full month names via
MONTH_DAY_YEAR_FORMAT; there's no off-by-one in the code.)Changes
Exempt the single rate-date warning from the length-based truncation in
getViolationTranslatePath. TheviolationMessage.length > 40term exists to shorten multi-violation summaries — a single legitimate warning shouldn't be collapsed. Gate the length term on there being more than one violation, e.g.:Or, more targeted: if the sole filtered violation is
customUnitRateOutOfDateRange, return{text: violationMessage}directly. This makes the preview match the opened-report behavior for both start-only and end-only rates.Investigation details & evidence (SHA
435a62d)TransactionPreviewContent.tsx:135—violationMessageis the translation offirstViolation = filterReceiptViolations(violations).at(0). For a workspace (group policy),shouldShowOnlyViolations = !isGroupPolicy = false, sofilteredViolations= all violations after receipt filtering.customUnitRateOutOfDateRangewarning, soviolationsCount = 1andfirstViolationis the rate warning in both cases — ordering is not a factor.violationsCount > 1is false;hasMissingSmartscanFieldsis false for a distance expense with a valid rate. The only differentiator is the 39-vs-42 length crossing the 40 boundary.customUnitRateOutOfDateRangeStartOnly=Rate is only valid from ${startDate},customUnitRateOutOfDateRangeEndOnly=Rate is only valid until ${endDate}— "until" plus a long end date ("December 31") pushes past 40.formatViolationDateusesMONTH_DAY_YEAR_FORMAT(MMMM d, yyyy) → full month names; the violationdatacopiesmileageRate.startDate/endDateverbatim with no arithmetic, so there's no year off-by-one or field swap.Confidence: High — root cause is deterministic from code + string lengths; every claim backed by code read at the merged SHA.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95109)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
rlinoz commentedon Jul 2, 2026
Yeah, as melvin explained, this is happening because the two messages have different lengths so that is expected and working as intended.