Skip to content

Expense-Rate list doesn't sorts rates by creation order (first created appears first) #72374

Closed

Description

@mitarachim

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: V9.2.29-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: #71529
Email or phone of affected tester (no customers): Slottwo1 ployee@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13 phone
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Go to workspace settings
  3. Enable distance rate and create few custom distance rates (example for name of distance rates : Z, zh, zz , A, G, B)
  4. Note the distance rates sorted in ascending order by name
  5. Go to workspace chat
  6. Create a distance expense
  7. Go to distance rate and add a rate
  8. Open the distance expense
  9. Open rate field
  10. Note the distance rates sorted in ascending order by name

Expected Result:

Step 4 and 9 : rate list sorts rates by creation order (first created appears first)

in production
Step 4 : the distance rates sorted in ascending order by name
Step 9 : rate list sorts rates by creation order (first created appears first)

Actual Result:

Step 4 and 9 : the distance rates sorted in ascending order by name

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6971130_1760119772668.Screenrecorder-2025-10-10-23-36-27-25.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Oct 11, 2025
  2. melvin-bot commented on Oct 11, 2025

    @melvin-bot

    Triggered auto assignment to @heyjennahay (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.

  3. melvin-bot commented on Oct 11, 2025

    @melvin-bot

    Triggered auto assignment to @cead22 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Oct 11, 2025

    @melvin-bot

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

  5. github-actions commented on Oct 11, 2025

    @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. mitarachim commented on Oct 11, 2025

    @mitarachim
    Author

    in production
    Step 4 : the distance rates sorted in ascending order by name

    Image

    Step 9 : rate list sorts rates by creation order (first created appears first)

    Image

    This is video while reproduce issue in Production :

    Screen.Recording.2025-10-11.at.10.57.28.AM.mov
  7. nyomanjyotisa commented on Oct 11, 2025

    @nyomanjyotisa
    Member

    This has a similar RCA to this issue

    We sort the rate alphabetically based on the rate name on both PolicyDistanceRatesPage (workspace settings) and IOURequestStepDistanceRate (expense rate picker). We additionally sort the rate on IOURequestStepDistanceRate to fix a different issue where rates appeared in random order after clearing cache and restarting the app

    Currently, we don't have any field from backend to define the default rate or which rate is created first. We cannot maintain creation order after cache clears because rates is stored as an object (Record<string, Rate>), and object property iteration order is not guaranteed to match the original array order from the backend. I think backend should add explicit fields like createdAt, sortOrder or isDefault to maintain the rate order. Ref to this and this comment for more context

  8. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    DeployBlockerIndicates it should block deploying the API
    on Oct 13, 2025
  9. mountiny commented on Oct 13, 2025

    @mountiny
    Contributor

    This just seems like a continuation of #71529 and I dont think its a blocker, assigning accordingly, can you please follow up?

  10. arosiclair commented on Oct 13, 2025

    @arosiclair
    Contributor

    Not a bug - we are now sorting rates alphabetically.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions