Skip to content
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

[HOLD for payment 2024-03-13] [HOLD for payment 2024-02-20] [$500] [MEDIUM] Distance - Address is duplicated when dragging one point over an empty point #33919

Closed
6 tasks done
lanitochka17 opened this issue Jan 4, 2024 · 58 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 4, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.21-3
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:

  1. Go to workspace chat > + > Request money > Distance
  2. Click Finish
  3. Enter an address and save it
  4. Hold and drag the Finish point above the Start point

Expected Result:

The Finish point will become Start point

Actual Result:

The Finish point is duplicated to become Start point
This issue also occurs when dragging Start point with address to below empty Finish point

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6331780_1704328200276.20240104_034302.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019049b6059932909e
  • Upwork Job ID: 1742713103147515904
  • Last Price Increase: 2024-01-04
  • Automatic offers:
    • tienifr | Contributor | 28081723
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 4, 2024
@melvin-bot melvin-bot bot changed the title Distance - Address is duplicated when dragging one point over an empty point [$500] Distance - Address is duplicated when dragging one point over an empty point Jan 4, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

Job added to Upwork: https://www.upwork.com/jobs/~019049b6059932909e

Copy link

melvin-bot bot commented Jan 4, 2024

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 4, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Jan 4, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

@tienifr
Copy link
Contributor

tienifr commented Jan 4, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

The Finish point is duplicated to become Start point
This issue also occurs when dragging Start point with address to below empty Finish point

What is the root cause of that problem?

In here, we're not clearing the empty waypoint by using removeWaypoint, so when we update in Onyx, it will not override the existing waypoint, leading to duplicate waypoint.

What changes do you think we should make in order to solve the problem?

Use removeWaypoint to remove the empty waypoints when dragging.

More detailed steps:

  • Find waypoints that currently is not empty but become empty after the drag
  • Use removeWaypoint on them to remove them from Onyx. We can modify the removeWaypoint method to removeWaypoints and allow removing multiple waypoints at once
  • updateWaypoints, then removeWaypoints in here. This might require returning the Onyx.set inside removeWaypoints so we can wait for it, similar to how we wait for the updateWaypoints. We can also optimize it by merging these 2 operations to allow both removing and updating waypoints in 1 Onyx.set operation (something like removeAndUpdateWaypoints), but this will require some refactoring.

What alternative solutions did you explore? (Optional)

NA

@aim-salam
Copy link

.

@parasharrajat
Copy link
Member

@tienifr's proposal makes sense to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 4, 2024

Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@yh-0218
Copy link
Contributor

yh-0218 commented Jan 4, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Distance - Address is duplicated when dragging one point over an empty point

What is the root cause of that problem?

return Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {

This is Onyx.merge problem.

What changes do you think we should make in order to solve the problem?

We can use Onyx.set.
But this has many problem. so we need to use Onyx.merge two times.

 comment: {
            waypoints: null
},

and then

comment: {
            waypoints,
},

then we can clear setOptimisticWaypoints(null);

What alternative solutions did you explore? (Optional)

@parasharrajat
Copy link
Member

parasharrajat commented Jan 4, 2024

@yh-0218 proposal is in very bad shape.

  1. No root cause explanation.
  2. You didn't mention what problems...
  3. How will this proposal solve the problems?

@yh-0218
Copy link
Contributor

yh-0218 commented Jan 4, 2024

hi, @parasharrajat when drag, waypoints value is correct.
like this {waypoint1: {lab: 1, ...}, waypoint2: {}}
but merged result is {waypoint1: {lab: 1, ...}, waypoint2: {lab: 1, ...}}
To solve this. we will get two step Onyx.merge
This works very well.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 4, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@stephanieelliott
Copy link
Contributor

Hey @tienifr is there a PR for this yet?

Copy link

melvin-bot bot commented Jan 8, 2024

@francoisl, @parasharrajat, @stephanieelliott, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@dylanexpensify dylanexpensify moved this to Release 2: Migration for All in [#whatsnext] Wave 05 - Deprecate Free Jan 8, 2024
@tienifr
Copy link
Contributor

tienifr commented Jan 9, 2024

There's an edge case that I'm working on.

@melvin-bot melvin-bot bot added the Overdue label Jan 11, 2024
@parasharrajat
Copy link
Member

Waiting on @tienifr's update.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 26, 2024
@francoisl
Copy link
Contributor

@tienifr any luck with the new fix?

@melvin-bot melvin-bot bot removed the Overdue label Mar 1, 2024
@tienifr
Copy link
Contributor

tienifr commented Mar 1, 2024

I'm opening it today.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 1, 2024
@tienifr
Copy link
Contributor

tienifr commented Mar 1, 2024

Please review the PR: #37585.

@stephanieelliott
Copy link
Contributor

New PR is on staging

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 6, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-02-20] [$500] [MEDIUM] Distance - Address is duplicated when dragging one point over an empty point [HOLD for payment 2024-03-13] [HOLD for payment 2024-02-20] [$500] [MEDIUM] Distance - Address is duplicated when dragging one point over an empty point Mar 6, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 6, 2024
Copy link

melvin-bot bot commented Mar 6, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.47-10 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-03-13. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Mar 6, 2024

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:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@parasharrajat] 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:
  • [@parasharrajat] A discussion in #expensify-bugs 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:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

  • Contributor: $250 ($500*50% regression penalty) @tienifr PAID via Upwork
  • Contributor+: $250 ($500*50% regression penalty) @parasharrajat please request via ND

Upwork job is here: https://www.upwork.com/jobs/~019049b6059932909e

@stephanieelliott
Copy link
Contributor

@parasharrajat bump to complete the BZ checklist please!

@parasharrajat
Copy link
Member

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:

Regression Test Steps

  1. Press FAB >> Request money >> Distance
  2. Choose one waypoint and leave the other empty
  3. Drag one waypoint over another to switch order
  4. Verify the empty and the filled waypoints are switched

Do you agree 👍 or 👎 ?

@parasharrajat
Copy link
Member

@stephanieelliott Done. Please close it when done. I will request it later.

@parasharrajat
Copy link
Member

Payment requested as per #33919 (comment)

@JmillsExpensify
Copy link

$250 approved for @parasharrajat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

10 participants