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
[Due for payment 2025-02-18] [$250] Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline #56071
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.0.92-1 Reproducible in staging?: Yes Reproducible in production?: Yes Email or phone of affected tester (no customers):applausetester+tw4466444@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 13.6/chrome App Component: Workspace Settings
Action Performed:
1, Go to Settings > Create Workspace.
2, Navigate to Workspace Settings > More Features > Enable Per Diem.
3,Go to Workspace Chat > Click + > Create Expense → Per Diem is available in the options.
4, Switch to Offline Mode, then go to Workspace Settings and change the currency.
5,Return to Workspace Chat > Click + > Create Expense → Per Diem is missing from the options.
Expected Result:
Per Diem should remain available in the expense details even after changing the currency offline.
Actual Result:
Per Diem disappears from the expense details when the currency is changed offline.
When changing the currency while offline, doesCurrentPolicyPerDiemExist becomes false, causing the Per Diem option to disappear. Why does this happen? When change the currency, we call the updateGeneralSettings action.
In this action, customUnits gets overridden when distanceUnit exists, leading to the policy losing the custom unit for Per Diem.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write a test to assert that Per Diem is enabled when changing the currency.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline[/-][+][$250] Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline[/+]on Feb 2, 2025
@arosiclair@MitchExpensify@dukenv0307@nkdengineer 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!
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jan 30, 2025
Triggered auto assignment to @MitchExpensify (
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.linhvovan29546 commentedon Jan 31, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-01-31 01:53:32 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline
What is the root cause of that problem?
We display the Per Diem option based on the following condition:
App/src/pages/iou/request/IOURequestStartPage.tsx
Lines 115 to 119 in 5f69e38
When changing the currency while offline,
doesCurrentPolicyPerDiemExistbecomes false, causing the Per Diem option to disappear.Why does this happen? When change the currency, we call the updateGeneralSettings action.
In this action,
customUnitsgets overridden whendistanceUnitexists, leading to the policy losing the custom unit for Per Diem.App/src/libs/actions/Policy/Policy.ts
Lines 1307 to 1312 in 5f69e38
What changes do you think we should make in order to solve the problem?
We should include the custom unit's current of the policy in
optimisticData,finallyData, andfailureData.App/src/libs/actions/Policy/Policy.ts
Lines 1327 to 1332 in 5f69e38
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write a test to assert that Per Diem is enabled when changing the currency.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Feb 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021886146687264382691
[-]Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline[/-][+][$250] Per Diem- Per Diem Disappears from Expense Options After Changing Currency Offline[/+]melvin-bot commentedon Feb 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)19 remaining items
melvin-bot commentedon Feb 13, 2025
@arosiclair @MitchExpensify @dukenv0307 @nkdengineer 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!
dukenv0307 commentedon Feb 13, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/39484/files#r1954731165
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/471536
Regression Test Proposal
Test:
Do we agree 👍 or 👎
MitchExpensify commentedon Feb 17, 2025
Added QA test
MitchExpensify commentedon Feb 17, 2025
Payment summary:
JmillsExpensify commentedon Feb 20, 2025
$250 approved for @dukenv0307
melvin-bot commentedon Feb 21, 2025
@arosiclair, @MitchExpensify, @dukenv0307, @nkdengineer Whoops! This issue is 2 days overdue. Let's get this updated quick!
MitchExpensify commentedon Feb 23, 2025
Paid @nkdengineer