Skip to content

Distance rates - Distance rate can be saved with only Start or End date selected #91383

Closed

Description

@applause-bot

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.3.79-1
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: #90153
Email or phone of affected tester (no customers): applausetester+khcategory19@applause.expensifail.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:

  • Log in with Expensifail account.
  • Enable Distance rates in workspace settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Distance rates.
  3. Click Add rate.
  4. Enter name and rate.
  5. Select only Start or End date.
  6. Click Save.

Expected Result:

When Start/End date is selected, it must require the End/Start date.

Actual Result:

Distance rate can be saved with only Start or End date is selected.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7160207_1779409778302.10.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7160207

Activity

  1. added
    DeployBlockerCash
    Bug
    on May 22, 2026
  2. applause-bot commented on May 22, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/b08a79f725531d5f55e7bdb3192b54cf17e47cf25c353b7fa84e9ecf14e533e5

  3. melvin-bot commented on May 22, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #90153

  4. melvin-bot commented on May 22, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on May 22, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on May 22, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The validateCreateDistanceRateForm function only validates that startDate comes before endDate when both are present:

    if (values.startDate && values.endDate && values.startDate > values.endDate) {

    If only one date is provided, the entire condition short-circuits to false and no error is raised. There is no check enforcing that the dates must be paired — so a rate can be saved with only a startDate or only an endDate.

    What changes do you think we should make in order to solve the problem?

    Add a paired-date validation check in validateCreateDistanceRateForm: if one of startDate/endDate is provided but the other is missing, set an error on the missing field. This requires adding a new translation key (e.g., workspace.distanceRates.errors.endDateRequired / startDateRequired) and the corresponding validation logic after line 83.

    What alternative solutions did you explore? (Optional)

    An alternative would be to enforce this at the UI level by auto-showing/requiring the second date picker when the first is filled. However, form-level validation is the standard pattern in this codebase and is more robust since it catches the issue regardless of how the form state is constructed.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. c3024 commented on May 22, 2026

    @c3024
    Contributor

    Expected Result:

    When Start/End date is selected, it must require the End/Start date.

    Actual Result:

    Distance rate can be saved with only Start or End date is selected.

    This is not a bug. The actual result is the expected result here. Please correct the test case that says both dates are required for distance rates when either date is provided.

  8. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on May 22, 2026
  9. rlinoz commented on May 22, 2026

    @rlinoz
    Contributor

    What @c3024 said, this is working as intended, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions