You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mileage rate is 0.00 for the newly created workspace instead of the rate set in the policy #10877
👋 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:
Identify the pull request that introduced this issue and revert it.
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.
Activity
OSBotify commentedon Sep 7, 2022
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Sep 7, 2022
Triggered auto assignment to @yuwenmemon (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.Julesssss commentedon Sep 7, 2022
Damn, this is a new regression occurring from another blocker fix.
@Expensify/mobile-deployers
yuwenmemon commentedon Sep 7, 2022
Looks like the workspace is undefined in Onyx when we first create it?

When I refresh the page and open the page again, the mileage rate shows and can be updated:
yuwenmemon commentedon Sep 7, 2022
Oh, interesting. The PolicyID changed for the workspace...
yuwenmemon commentedon Sep 7, 2022
Actually wait no, I think the problem is that there are two custom units on the initially created policy...

yuwenmemon commentedon Sep 7, 2022
So somewhere we're not keying the customUnit by the ID when we update Onyx 🤔
yuwenmemon commentedon Sep 7, 2022
I would guess it's this line:
App/src/libs/actions/Policy.js
Line 90 in 367b662
yuwenmemon commentedon Sep 7, 2022
Hm no actually it's coming from the

CreateWorkspaceAPI command:yuwenmemon commentedon Sep 7, 2022
Hm yeah - so the problem is that the structure with which we hold Custom Units in OldDot is as an array:
But in NewDot we want it to be an object keyed by the CustomUnitID:

yuwenmemon commentedon Sep 7, 2022
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.
Julesssss commentedon Sep 8, 2022
Thanks so much, this works perfectly 😍
Fixed.mov
amyevans commentedon Sep 8, 2022
Oh goodness, thanks for fixing @yuwenmemon and @Julesssss ❤️