Skip to content

Mileage rate is 0.00 for the newly created workspace instead of the rate set in the policy #10877

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing #10692

Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Create a New Workspace
  3. Go to to Settings -> [Workspace] -> Reimburse expenses
  4. Try to change the mileage rate and the mi/km selector

Expected Result:

  1. Mileage rate should display the value you have in your policy
  2. The mileage rate should be editable
  3. The miles/km selector must be operational

Actual Result:

  1. A new workspace is created with 0.00 milage rate (the rate is set in this policy)
  2. When you try to edit the mileage rate, you get an error
  3. Cannot change miles to kilometers

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Mobile Web

Version Number: v1.1.97-7
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+ihchat4@applause.expensifail.com / Yulia1986Gerets
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: https://user-images.githubusercontent.com/43996225/188964955-fd47cd77-6122-44e9-b33b-956300963889.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

View all open jobs on GitHub

Activity

  1. OSBotify commented on Sep 7, 2022

    @OSBotify
    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.
  2. melvin-bot commented on Sep 7, 2022

    @melvin-bot

    Triggered auto assignment to @yuwenmemon (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. Julesssss commented on Sep 7, 2022

    @Julesssss
    Contributor

    Damn, this is a new regression occurring from another blocker fix.

    @Expensify/mobile-deployers

  4. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Looks like the workspace is undefined in Onyx when we first create it?
    Screen Shot 2022-09-07 at 1 25 10 PM

    When I refresh the page and open the page again, the mileage rate shows and can be updated:

    Screen Shot 2022-09-07 at 1 33 07 PM

  5. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Oh, interesting. The PolicyID changed for the workspace...

  6. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Actually wait no, I think the problem is that there are two custom units on the initially created policy...
    Screen Shot 2022-09-07 at 1 40 49 PM

  7. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    So somewhere we're not keying the customUnit by the ID when we update Onyx 🤔

  8. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    I would guess it's this line:

    customUnits: lodashGet(fullPolicyOrPolicySummary, 'value.customUnits', {}),

  9. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Hm no actually it's coming from the CreateWorkspace API command:
    Screen Shot 2022-09-07 at 2 19 42 PM

  10. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Hm yeah - so the problem is that the structure with which we hold Custom Units in OldDot is as an array:

    Screen Shot 2022-09-07 at 2 25 22 PM

    But in NewDot we want it to be an object keyed by the CustomUnitID:
    Screen Shot 2022-09-07 at 2 26 51 PM

  11. yuwenmemon commented on Sep 7, 2022

    @yuwenmemon
    Contributor

    Ah yep, so @amyevans @jasperhuangg we just missed one spot here - we also want to do the data massaging we do in Getting the policy when we Create the policy as well.

  12. Julesssss commented on Sep 8, 2022

    @Julesssss
    Contributor

    Thanks so much, this works perfectly 😍

    Fixed.mov

    Screenshot_20220908-010228

  13. amyevans commented on Sep 8, 2022

    @amyevans
    Contributor

    Oh goodness, thanks for fixing @yuwenmemon and @Julesssss ❤️

  14. deleted a comment from melvin-bot on Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions