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
[Payment due][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline #34686
changed the title [-]Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/-][+][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/+]on Jan 17, 2024
When we are creating a new request, we correctly remove the waypoint from a draft transaction. But when we edit an existing transaction, we should modify the real, not draft transaction.
What changes do you think we should make in order to solve the problem?
We should pass the isDraft parameter conditionally depending on the IOU action, similar to how we pass it to Transaction.saveWaypoint: action === CONST.IOU.ACTION.CREATE
📣 @Vlad-AIMaster! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
We always pass isDraft: true to removeWaypoint function, so that new updates will be saved to the draft transaction
What changes do you think we should make in order to solve the problem?
After refactoring, we use action field from the route to indentify if users create or edit their request. So we also need to rely on action field from the route to determine whether we should save new data into a transaction or a draft transaction
One more thing that the above proposal is omitted, we also need to update isDraft pram to action === CONST.IOU.ACTION.CREATE for updateWaypoint function here
@lschurr this can be taken off hold – #37560 is in Production already.
Also, it seems like the issue was fixed by 4641b08 while the PR was on hold for Onyx fix.
Recently had a similar case and got this comment by @mallenexpensify . Not completely sure if it also applies here
VictoriaExpensify both nyomanjyotisa and alitoshmatov are due compensation here. Per the internal SO
If a contributor has been hired for a job and we decide to close the job before it is successfully completed, full payment is due for C+ and the contributor. One caveat here might be if the hired contributor wasn't working on their PR with urgency. If you're unsure, post in #bug-zero.
Thanks @paultsimura and @alitoshmatov - I checked with the team and we agreed that we should pay full comp for the contributor on the PR and half comp to the C+ since proposals were reviewed but the PR was not.
changed the title [-][HOLD #37560][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/-][+][Payment due][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/+]on Aug 12, 2024
Activity
[-]Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/-][+][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/+]melvin-bot commentedon Jan 17, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01979a5064cc9154e6
melvin-bot commentedon Jan 17, 2024
Triggered auto assignment to @lschurr (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 17, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)isagoico commentedon Jan 17, 2024
Posting @paultsimura proposal here:
Proposal
Please re-state the problem that we are trying to solve in this issue.
When editing a Distance request offline, the waypoint cannot be removed
What is the root cause of that problem?
This is because we do not handle the Editing flow correctly when passing the isDraft parameter to
Transaction.removeWaypoint: we passtruealways:App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 145 in 1f72b5f
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 165 in 1f72b5f
When we are creating a new request, we correctly remove the waypoint from a draft transaction. But when we edit an existing transaction, we should modify the real, not draft transaction.
What changes do you think we should make in order to solve the problem?
We should pass the
isDraftparameter conditionally depending on the IOU action, similar to how we pass it toTransaction.saveWaypoint:action === CONST.IOU.ACTION.CREATEApp/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 138 in 1f72b5f
What alternative solutions did you explore? (Optional)
isagoico commentedon Jan 17, 2024
@tgolen confirmed the bug and the proposed fix here: https://expensify.slack.com/archives/C049HHMV9SM/p1705505264249909
Vlad-AIMaster commentedon Jan 18, 2024
I will take a look at the issue and come up with a solution.
melvin-bot commentedon Jan 18, 2024
📣 @Vlad-AIMaster! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
DylanDylann commentedon Jan 18, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The waypoint is not deleted after hitting the option to delete. After going back online, the 3 waypoints are still displayed.
What is the root cause of that problem?
The RCA here
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 145 in 4da7fda
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 165 in 4da7fda
We always pass
isDraft: truetoremoveWaypointfunction, so that new updates will be saved to the draft transactionWhat changes do you think we should make in order to solve the problem?
After refactoring, we use
actionfield from the route to indentify if users create or edit their request. So we also need to rely onactionfield from the route to determine whether we should save new data into a transaction or a draft transactionSo, in these places
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 145 in 4da7fda
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 165 in 4da7fda
We should update
isDraftpram toaction === CONST.IOU.ACTION.CREATElike we did hereApp/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 138 in 1f72b5f
One more thing that the above proposal is omitted, we also need to update
isDraftpram toaction === CONST.IOU.ACTION.CREATEforupdateWaypointfunction hereApp/src/pages/iou/request/step/IOURequestStepDistance.js
Line 159 in 4da7fda
The updateWaypoint function also be used here
App/src/components/DistanceRequest/index.js
Line 203 in 4da7fda
But this component will be removed here and we only use IOURequestStepDistance so that we don't need to fix in here
What alternative solutions did you explore? (Optional)
NA
102 remaining items
paultsimura commentedon Aug 9, 2024
@lschurr this can be taken off hold – #37560 is in Production already.
Also, it seems like the issue was fixed by 4641b08 while the PR was on hold for Onyx fix.
Here's the timeline:
Should we be eligible for compensation here if the issue was resolved by another PR while this one was in progress?
alitoshmatov commentedon Aug 10, 2024
Recently had a similar case and got this comment by @mallenexpensify . Not completely sure if it also applies here
lschurr commentedon Aug 12, 2024
Thanks @paultsimura and @alitoshmatov - I checked with the team and we agreed that we should pay full comp for the contributor on the PR and half comp to the C+ since proposals were reviewed but the PR was not.
Payment summary:
[-][HOLD #37560][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/-][+][Payment due][$500] Distance Expense - Impossible to remove a waypoint when editing a distance request offline[/+]paultsimura commentedon Aug 12, 2024
Thanks, I've accepted the offer.
lschurr commentedon Aug 19, 2024
All set!