Skip to content

[Due for payment 2026-06-22] [Due for payment 2026-06-19] Distance - Deleted rate is shown as inactive briefly after deleting it #93355

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.4.6-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #90920
Email or phone of affected tester (no customers): iosjnnsjdosnjsodj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Enable Distance rates.
  • Have at least two distance rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Distance rates.
  3. Delete any rate.

Expected Result:

Deleted rate will disappear immediately.

Actual Result:

Deleted rate is shown as inactive briefly after deleting it.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7178400_1781222492976.2.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7178400

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. applause-bot commented on Jun 12, 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/45f5abd844ac719b4ebe346e52f9bdcc5f18b6c6d6cfec0aebcc0bb0cde29dd4

  2. added
    DeployBlockerCash
    Bug
    on Jun 12, 2026
  3. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 12, 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 Jun 12, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After deleting a distance rate, the row briefly shows a gray "Inactive" status badge before disappearing, instead of disappearing immediately.

    What is the root cause of that problem?

    Regression from #90920 (new Distance rates table UI). Deletion is optimistic: deletePolicyDistanceRates merges {enabled: false, pendingAction: 'delete'} onto the rate and leaves it in the collection until the server response removes it.

    Two new behaviors then make that optimistic window visible:

    1. The new status helper getRateStatus returns INACTIVE whenever !rate.enabled and never checks pendingAction, so a mid-delete rate (enabled: false) renders the gray "Inactive" badge.
    2. The new row opts out of the auto-hide that the old list relied on by passing shouldHideOnDelete: false to OfflineWithFeedback. With the default (true), the row's children are hidden once pendingAction === 'delete', matching the pre-PR "disappears immediately" behavior.

    The old list had no status badge and relied on OfflineWithFeedback's default hide-on-delete, so this is purely a new-UI regression.

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

    Make the badge ignore optimistic-delete state. Guard getRateStatus so a pending-delete rate isn't reported as INACTIVE — in PolicyDistanceRatesUtils.ts:174, short-circuit when rate.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE (return the prior/active status so no gray badge flashes).

    Lowest-risk alternative: remove shouldHideOnDelete: false (or set it to true) at WorkspaceDistanceRatesTableRow.tsx:95 so the whole row hides during the optimistic delete (exactly the old behavior). Note OfflineWithFeedback only hides when there are no errors, so a failed delete still surfaces correctly. This option also hides the row instantly rather than just fixing the badge color, so it's the closer match to the expected result.

    Investigation details & data flow
    1. Delete → deleteRates calls deletePolicyDistanceRates.
    2. Onyx merges {enabled: false, pendingAction: 'delete'}; rate stays in the collection (no successData removes it — it's removed only when the BE replaces customUnits.<id>.rates).
    3. ratesData is not filtered for pending-delete, so the row still renders with enabled: false.
    4. getRateStatus sees !enabled → INACTIVE → gray badge.
    5. shouldHideOnDelete: false prevents OfflineWithFeedback from hiding the row, so the badge stays visible until the server response removes the rate.

    Confidence: High — confirmed end-to-end against the merge commit and verified the pre-PR list had no status badge.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93355) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. added
    Reviewing
    on Jun 12, 2026
  8. Krishna2323 commented on Jun 12, 2026

    @Krishna2323
    Contributor
  9. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  10. JS00001 commented on Jun 12, 2026

    @JS00001
    Contributor

    Tested on staging, this is fixed

  11. removed
    DeployBlockerCash
    Hourly
    on Jun 12, 2026
  12. added
    Daily
    and removed
    Reviewing
    on Jun 12, 2026
  13. changed the title [-]Distance - Deleted rate is shown as inactive briefly after deleting it[/-] [+][Due for payment 2026-06-19] Distance - Deleted rate is shown as inactive briefly after deleting it[/+] on Jun 12, 2026
  14. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-19. 🎊

    For reference, here are some details about the assignees on this issue:

    • @Krishna2323 requires payment through NewDot Manual Requests
  16. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @Krishna2323 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  17. changed the title [-][Due for payment 2026-06-19] Distance - Deleted rate is shown as inactive briefly after deleting it[/-] [+][Due for payment 2026-06-22] [Due for payment 2026-06-19] Distance - Deleted rate is shown as inactive briefly after deleting it[/+] on Jun 15, 2026
  18. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.7-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-22. 🎊

    For reference, here are some details about the assignees on this issue:

    • @Krishna2323 requires payment through NewDot Manual Requests
  19. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    @Krishna2323 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

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