-
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
[$500] Distance - Duplicate waypoint error message is not dimissed after closing distance editor #34999
Comments
Job added to Upwork: https://www.upwork.com/jobs/~018929236a56deb238 |
Triggered auto assignment to @JmillsExpensify ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
We think that this bug might be related to #wave6. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The "Duplicate waypoint" error remains between the "edit distance" page refreshes. What is the root cause of that problem?For the distance request, we use a hook that restores the transaction to the original one if it was not saved: App/src/components/DistanceRequest/index.js Lines 117 to 126 in 872eb17
However, in this issue's scenario, we save the transaction ( What changes do you think we should make in order to solve the problem?We should add an extra check – early return only if the transaction was saved without a route error: return () => {
// If the user cancels out of the modal without saving changes, then the original transaction
// needs to be restored from the backup so that all changes are removed.
if (transactionWasSaved.current && !hasRouteError) {
return;
}
TransactionEdit.restoreOriginalTransactionFromBackup(transaction.transactionID);
}; What alternative solutions did you explore? (Optional) |
Proposal Please re-state the problem that we are trying to solve in this issue. What is the root cause of that problem? What changes do you think we should make in order to solve the problem? Ensure hasError Resets on Page Refresh: Review and Update submitWaypoints Logic: Improve Waypoints Update Logic: What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - waypoint error message is not dimissed after closing distance editor What is the root cause of that problem?We are using Onyx to store and persist errors inside the transaction object: App/src/types/onyx/Transaction.ts Line 60 in 0efabc2
Because of this when we got an error we going to keep it at least we save the waypoints again. What changes do you think we should make in order to solve the problem?We should clean the transaction errors when unmount the Distance request component inside the next line: App/src/components/DistanceRequest/index.js Line 117 in 0efabc2
The code result should be:
And the cleanTransactionErrors could be (inside of https://github.com/Expensify/App/blob/main/src/libs/actions/TransactionEdit.ts):
Result: Distance.request.error.test.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - Duplicate waypoint error message is not dimissed after closing distance editor What is the root cause of that problem?We save the waypoints even if we have duplicates & thats why its been stored in ONYX and it persists after refresh. What changes do you think we should make in order to solve the problem?We should not save the waypoint if we have duplicates. We need to return from here: App/src/components/DistanceRequest/index.js Line 212 in 0efabc2
To validate we can add an extra check like, We already have done it inside App/src/pages/iou/request/step/IOURequestStepDistance.js Lines 168 to 170 in 0efabc2
Result |
Proposal UpdatedAdded permalink for reference. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The duplicate waypoint error message is not dismissed What is the root cause of that problem?We're not validating duplicate waypoints when editing waypoints, so when we call the API to save it, it will return a back-end error which will not be cleared when we reload the page. What changes do you think we should make in order to solve the problem?Make sure to validate duplicate waypoints and show the duplicate waypoints error properly when editing waypoints
We can consider making the What alternative solutions did you explore? (Optional)NA |
@JmillsExpensify, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too... |
Missed this one, reviewing today |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@paultsimura Thank you for your proposal. Even if transaction is restored when closing the page, error is still persisting. |
@JordanLevy19 Don't get me wrong but your proposal looks like written by a chatbot, it is very vague and has no context awareness |
Hey @alitoshmatov - not wrong at all - this was actually my first go at one of these bugs, and I have definitely learned to be more specific about the issues and to and identify as much as possible where the actual bugs reside in the code files and components! Thank you for the feedback! |
@Krishna2323 Thank you for your proposal, you are suggesting how to prevent duplicate waypoints from being submitted. I think your solution is not complete because there is no error handling there. You are just preventing user from submitting duplicate waypoints |
@samilabud Thank you for your proposal. Your RCA is correct and your solution does solve this issue. But I am not sure if it is expected behavior to clean all transaction errors when distance page is closed |
@tienifr Thank you for your proposal. Your RCA is correct. I do agree we should validate waypoints and show duplicate error before user submits the edit just like creating distance request. |
@alitoshmatov Thanks! Do you think we can move forward with my proposal? |
In #34441 we have proposed to use a draft transaction for editing waypoints, which would solve this issue. |
@kmbcook Can you elaborate how that issue will solve ours? |
@alitoshmatov sorry, I was wrong. |
Triggered auto assignment to @tgolen, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
LGTM 👍 |
📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@JmillsExpensify @tgolen @alitoshmatov @tienifr 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! |
@JmillsExpensify PR hit production. Melvin is malfunctioning. Please add HOLD for payment label. |
@JmillsExpensify Would you mind helping with payment here? Thanks |
@JmillsExpensify Bump |
If you need something urgent please please reach out to me in Slack in our open source community or directly 1:1. Sorry for the delay! |
Payment summary:
Also @alitoshmatov I don't believe I've seen a BZ checklist. Can you please complete one? Thank you. |
All contributors have been paid out though please @alitoshmatov help with the BZ checklist before we can close this on out! |
@alitoshmatov bump on the BZ checklist. |
cc: @JmillsExpensify |
Great thanks so much! Given no regression test is required, I'll close the issue. |
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: 1.4.30-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:
Precondition: App location access is disabled
Expected Result:
The duplicate waypoint error message is dismissed
Actual Result:
The duplicate waypoint error message is not dismissed
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6352460_1706039016934.20240123_235006.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @JmillsExpensifyThe text was updated successfully, but these errors were encountered: