-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WAITING ON FEDI - CHECKLIST] Web - Distance - Amount does not change if waypoint is changed via distance option #34226
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01eb4b0c3cc7b8e197 |
Triggered auto assignment to @jliexpensify ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Amount does not change if waypoint is changed via distance option. What is the root cause of that problem?In the What changes do you think we should make in order to solve the problem?We should set What alternative solutions did you explore?[FIRST EDIT - Alternative solution added] From what I see, A. let the component calculate it each time. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - Amount does not change if waypoint is changed via distance option What is the root cause of that problem?The root cause is that
What changes do you think we should make in order to solve the problem?We should Change it to
What alternative solutions did you explore? (Optional)We can also use the same technique for
or We can also use transaction.amount here
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The amount does not change when user changes the finish point via the distance option from the confirmation page (without going back two times) What is the root cause of that problem?We're not clearing the When we save the new waypoint, we're already setting the amount to 0 here. It should have triggered this line to calculate and update the new correct amount to Onyx. But it didn't work because the distance is still stale (not updated via back-end yet), so the amount to be saved is still the old amount, we can verify this by adding logs, it will show that the transition of the amount is So the problem here is that the distance is stale when saving new waypoint. What changes do you think we should make in order to solve the problem?Clear the
It doesn't make sense to keep the distance because the waypoint is already changed and the distance will be recalculated. We're already doing the same when removing the waypoint here We also already clearing the old route here when saving waypoint due to the same reason.
What alternative solutions did you explore? (Optional)We can check other operations related to amount as well, and make sure we also remove the distance in that case. |
Bump @fedirjh for reviews. I've also let Dylan know here: https://expensify.slack.com/archives/C05DWUDHVK7/p1705021251503859 |
Thanks everyone for the proposal. I believe @dukenv0307 has correctly identified the root cause of the bug. Let's proceed with this proposal from @dukenv0307 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@fedirjh |
I am not really sure how removing that logic will fix this bug? As I stated, the bug arises from stale data not from the custom logic, So even if we remove the custom logic, we will still use the stale data (in this case the distance), and the bug will still exist. |
Can you please elaborate more on this? why doesn't the hook work in this case? The amount is reset to 0 when we save a new waypoint, So technically the hook should work. From the testing, it seems that the hook works fine, but it uses the old distance value. App/src/libs/actions/Transaction.ts Line 67 in 1f7a97b
|
I logged
First 2 logs are from the first time we enter the component in this flow. Next 4 ones are after changing the distance from the component. Indeed, we use the old distance value when I think you two are right, clearing the
Thus, preventing cases like this one and also taking unit and rate into account. Maybe we may do both things, or just that fix. In any case, I'm sure you know better which is the right solution here. |
@DanutGavrus I think it will only hide the bugs. If the data is stale, that fix will make it looks like it's working fine. But in reality the data is still stale and will cause bugs and unintended side effects in other places. So IMO we should fix it at the root. |
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@Beamanator, @jliexpensify, @fedirjh, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Not overdue! PR being worked on |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.33-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-02-07. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@Beamanator, @jliexpensify, @fedirjh, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Seems like still waiting on payment - bump @jliexpensify |
Oh hey sorry, missed this one! @fedirjh bump on the checklist please |
Paid and job closed |
BugZero Checklist:
Regression Test Proposal
|
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v1.4.23-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
The amount should change since the finish point has been changed
Actual Result:
The amount does not change when user changes the finish point via the distance option from the confirmation page (without going back two times)
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6337433_1704875155064.PR-Fail-33959.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: