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
[DISTANCE] MEDIUM: [$500] Only allow admins to manually edit distance request amount and currency #30654
BugSomething is broken. Auto assigns a BugZero manager.DistanceWave5-free-submittersInternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2
Please re-state the problem that we are trying to solve in this issue.
Unable to change currency when offline in distance request
What is the root cause of that problem?
Currently, when calling UpdateDistanceRequest with currency data, BE does not update the currency, it still returns the original currency.
When the user is in offline mode, and updates currency from "A" to "B", optimisticData is update to B. Then turn on the network, API will be called and updated to currency to A. That leads to the current behavior.
What changes do you think we should make in order to solve the problem?
We should not allow editing the amount or currency when creating distance request or editing distance request. We only allow the admin of the workspace to edit the amount or currency when editing distance request.
We need to disable the amount field when creating distance request
In here
OR, we can dismiss modal if the user goes to the edit page by deep link
We also need update from BE follow this requirement: We should not allow editing the amount or currency when creating distance request or editing distance request. We only allow the admin of the workspace to edit the amount or currency when editing distance request.
changed the title [-]Unable to change currency when offline in distance request[/-][+][$500] Unable to change currency when offline in distance request[/+]on Nov 1, 2023
Please re-state the problem that we are trying to solve in this issue.
Unable to change currency when offline in distance request
What is the root cause of that problem?
When we update the currency using 'distance request' we use a method called IOU.updateDistanceRequest, this method doesn't update the currency (this behavior occurs online - if you update the page you can see the currency is the first one you selected- and offline).
These are the API request and response of IOU.updateDistanceRequest function:
What changes do you think we should make in order to solve the problem?
I think the simplest change is to call the function (used in the manual request) IOU.editMoneyRequest method when using 'distance request' as shown below :
Please re-state the problem that we are trying to solve in this issue.
Changing the distance request currency will revert back to the previous currency.
What is the root cause of that problem?
When we change the currency of a distance request, we will optimistically update it, but the BE actually doesn't allow it, so the value/currency will be reverted.
What changes do you think we should make in order to solve the problem?
Currently, BE doesn't allow us to change the distance request currency, but allows us to change the distance request amount. I'm pretty sure we want to disallow both because on the distance request confirm page, the amount button is completely disabled. This is because the amount is calculated from the distance.
So, my suggestion is to also disable the amount button on the report/chat page if it's a distance request.
BugSomething is broken. Auto assigns a BugZero manager.DistanceWave5-free-submittersInternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2
Activity
DylanDylann commentedon Oct 31, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
UpdateDistanceRequestwith currency data, BE does not update the currency, it still returns the original currency.optimisticDatais update to B. Then turn on the network, API will be called and updated to currency to A. That leads to the current behavior.What changes do you think we should make in order to solve the problem?
Firstly, please check this discussion: https://expensify.slack.com/archives/C01GTK53T8Q/p1698949355446899?thread_ts=1697575566.549679&cid=C01GTK53T8Q
We should not allow editing the amount or currency when creating distance request or editing distance request.
We only allow the admin of the workspace to edit the amount or currency when editing distance request.
In here
App/src/components/MoneyRequestConfirmationList.js
Line 593 in cd1c2bd
we should update like this
In here
App/src/components/ReportActionItem/MoneyRequestView.js
Lines 185 to 186 in cd1c2bd
Update like this
In here
App/src/pages/EditRequestPage.js
Line 167 in 11a7170
update like this
OR, we can dismiss modal if the user goes to the edit page by deep link
In here
App/src/pages/iou/steps/NewRequestAmountPage.js
Line 167 in 11a7170
update like this
OR, we can dismiss modal if the user goes to the edit page by deep link
We also need update from BE follow this requirement:
We should not allow editing the amount or currency when creating distance request or editing distance request.
We only allow the admin of the workspace to edit the amount or currency when editing distance request.
melvin-bot commentedon Oct 31, 2023
Triggered auto assignment to @twisterdotcom (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 31, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)[-]Unable to change currency when offline in distance request[/-][+][$500] Unable to change currency when offline in distance request[/+]melvin-bot commentedon Nov 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f9c85c43ba1d6c35
melvin-bot commentedon Nov 1, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)samilabud commentedon Nov 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Unable to change currency when offline in distance request
What is the root cause of that problem?
When we update the currency using 'distance request' we use a method called IOU.updateDistanceRequest, this method doesn't update the currency (this behavior occurs online - if you update the page you can see the currency is the first one you selected- and offline).
App/src/pages/EditRequestPage.js
Line 128 in 5d45f0f
These are the API request and response of IOU.updateDistanceRequest function:
What changes do you think we should make in order to solve the problem?
I think the simplest change is to call the function (used in the manual request) IOU.editMoneyRequest method when using 'distance request' as shown below :
App/src/pages/EditRequestPage.js
Line 126 in 5d45f0f
This is the result:
Fixed.Unable.to.change.currency.when.offline.in.distance.request.test.mp4
bernhardoj commentedon Nov 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Changing the distance request currency will revert back to the previous currency.
What is the root cause of that problem?
When we change the currency of a distance request, we will optimistically update it, but the BE actually doesn't allow it, so the value/currency will be reverted.
What changes do you think we should make in order to solve the problem?
Currently, BE doesn't allow us to change the distance request currency, but allows us to change the distance request amount. I'm pretty sure we want to disallow both because on the distance request confirm page, the amount button is completely disabled. This is because the amount is calculated from the distance.
So, my suggestion is to also disable the amount button on the report/chat page if it's a distance request.
App/src/components/ReportActionItem/MoneyRequestView.js
Lines 179 to 190 in 3db5ff4
77 remaining items
melvin-bot commentedon Jan 4, 2024
Current assignee @alitoshmatov is eligible for the Internal assigner, not assigning anyone new.
twisterdotcom commentedon Jan 4, 2024
Eugh, it will do the same for Neil. Let me see who's on the Wave 5 team.
alitoshmatov commentedon Jan 4, 2024
The PR is here #31778
alitoshmatov commentedon Jan 18, 2024
The PR was deployed to product in 9th of january. I think this one is ready for payment
cc: @twisterdotcom
twisterdotcom commentedon Jan 18, 2024
Weird we didn't get the automation. Okay, gonna send offers to you all.
twisterdotcom commentedon Jan 18, 2024
Oh wait, the offers are there. Weird. Sorry for the duplicate offers - I withdrew the ones I just made and paid the ones we automated last year. Okay:
Payment Summary:
@alitoshmatov paid $500 here (C+)
@DylanDylann paid $500 here (Contributor)
@esh-g paid $50 here (Reporter)
twisterdotcom commentedon Jan 18, 2024
Gonna close, no need for regression.