Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.4.49-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176744/test-cases/41237134
Email or phone of affected tester (no customers): - applausetester+84206@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11 / Chrome
App Component: Other
Action Performed:
- Login with new account
- Create a new workspace
- Navigate to more features > Enable Distance rates (Or any feature like accounting, Expensify card, HR, Tags...)
Expected Result:
The features can be enabled and appear in the workspace settings page
Actual Result:
Feature can't be enabled. Togle became disabled automatically
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7225412_1785836466069.bandicam_2026-08-04_12-39-47-677.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7225420
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022084580830235141063
- Upwork Job ID: 2084580830235141063
- Last Price Increase: 2026-08-04
Issue Owner
Current Issue Owner: @mountinyMetadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Aug 4, 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/370aa64c08162903250ec549a9e6f6190853327b551a133fa39c968b0e32faf0
MelvinBot commentedon Aug 4, 2026
Issue Analysis
Root Cause: This is a backend issue, not an App bug. When you enable Distance rates, the App optimistically flips the toggle on and sends the
EnablePolicyDistanceRatescommand. The backend accepts the request but does not persistareDistanceRatesEnabled = true(it signals a failurejsonCodeand/or pushes the flag back asfalse), so the App rolls the toggle back to OFF via itsfailureData. I confirmed this live on web: creating a fresh workspace and toggling Distance rates firesEnablePolicyDistanceRates(HTTP 200 — expected for all Expensify API calls regardless of outcome), yet the toggle reverts to OFF every time and no Distance rates tab is added.Where the fix lives: Outside this repo — in the backend
EnablePolicyDistanceRatescommand handler (Auth/Web-Expensify). The App client code is correct and has no path to fix this. This needs an internal engineer with backend access to investigate why the command isn't persisting the enabled state on newly-created workspaces (likely a missing default distancecustomUnit/rate precondition or a rolled-back write).The
applause-botreproduction confirms it's broken in staging and production on Web (Chrome), macOS, and iOS — consistent with a server-side cause hitting all platforms.Investigation details & evidence
Client-side flow (all public App code, confirmed correct):
onTogglejust callsenablePolicyDistanceRates(policyID, isEnabled, distanceRateCustomUnit)with no upgrade/billing gate —WorkspaceMoreFeaturesPage/index.tsx:545-550.policy?.areDistanceRatesEnabled—index.tsx:541.areDistanceRatesEnabled: trueoptimistically, keeps ittrueon success, and only writes it back tofalseinfailureData—DistanceRate.ts:54-133(revert at L81-L92). ThecustomUnitsmanipulation only runs when disabling (if (!enabled && customUnit)), so it plays no part in the enable failure, and there is no client-side validation blocking the enable. The only way the flag ends upfalseafter a completed request is a server-signaled failure.Live web reproduction (this run): Created a new workspace → More features → tapped Distance rates. The toggle reverted to OFF each of 3 attempts;
POST /api/EnablePolicyDistanceRatesreturned status 200 each time, but the flag never stuck and no Distance rates nav tab appeared. A generic "add payment method" free-trial nag surfaced on one attempt — this appears incidental to the trial state, not the toggle mechanism.Distance rates toggle OFF before tapping:

Toggle reverted to OFF immediately after enabling:

Free-trial "add payment method" nag seen during testing (incidental):

Not accessible in this run: Production VictoriaLogs (CI runner has no VL access), so I could not read the exact backend
jsonCode/error. An internal engineer should query theEnablePolicyDistanceRatescommand for a freshly-created workspace's policyID around the report date to see the failure code / precondition.Alternative explanations considered & ruled out: (1) A client upgrade/subscription gate reverting the toggle — ruled out, distance rates has no such gate in the handler. (2) The
customUnitsrate logic corrupting state on enable — ruled out, that branch only runs on disable. (3) A flaky one-off — ruled out, it reproduced 3/3 and applause-bot reproduced across staging/prod and multiple platforms.Confidence: Medium-High. Client behavior is confirmed correct by both static analysis and live reproduction; the backend cause is strongly implied by "request completes but flag doesn't persist," but the exact backend precondition needs internal logs/code to pin down.
Next Steps: This requires a backend fix outside
Expensify/App, so it can't be implemented from this repo. An internal engineer should investigate theEnablePolicyDistanceRatescommand's handling of newly-created workspaces. Reply with@MelvinBot <feedback>to refine this analysis.melvin-bot commentedon Aug 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ChavdaSachin (
External)melvin-bot commentedon Aug 4, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022084580830235141063
melvin-bot commentedon Aug 7, 2026
@ChavdaSachin Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Aug 11, 2026
@ChavdaSachin Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Aug 13, 2026
@ChavdaSachin 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
melvin-bot commentedon Aug 17, 2026
@ChavdaSachin 12 days overdue. Walking. Toward. The. Light...
melvin-bot commentedon Aug 18, 2026
@ChavdaSachin this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
ChavdaSachin commentedon Aug 19, 2026
🎀 👀 🎀 C+ reviewed
BE issue
melvin-bot commentedon Aug 19, 2026
Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
m-natarajan commentedon Aug 19, 2026
@mountiny Added the email associated with this issue applausetester+84206@applause.expensifail.com
m-natarajan commentedon Aug 19, 2026
Chrome / v9.4.56-0
Passed
REC-20260819215636.mp4
Recording.3386.mp4
mountiny commentedon Aug 19, 2026
Perfect, thank you