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

[WAITING ON MIROSLAV] [HOLD for payment 2023-10-02] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor #26888

Closed
6 tasks done
hayata-suenaga opened this issue Sep 6, 2023 · 72 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@hayata-suenaga
Copy link
Contributor

hayata-suenaga commented Sep 6, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

I recommend following the following reproduction steps in a fresh account

  1. Open NewDot on Chrome
  2. Go to a workspace chat
  3. Click on the "+" icon next to the text composer
  4. Select "Request money" and then choose "Distance"
  5. Add addresses for "Start" and "Finish"
  6. Click "Add stop" several times to create empty "Stop"s
  7. Click "Next"
  8. Open the developer console of Chrome and go to the Application tab > Storage > IndexedDB -> OnyxDB -> keyvaluepairs
  9. Find the draft transaction being created. You can type "transaction" on the search field.
    This is tricky if you have already several transactions. That's the reason I recommends using a new account
    Screenshot 2023-09-06 at 8 51 40 AM

Expected Result:

Waypoints should only contains valid waypoints, and none of them should be unfilled.
Screenshot 2023-09-06 at 8 48 27 AM

Actual Result:

Invalid / empty waypoints are in transaction.
Screenshot 2023-09-06 at 8 56 39 AM

Workaround:

This doesn't affect the user directly, but the Onyx data should be cleaned to reflect the state of the database.

Platforms:

Which of our officially supported platforms is this issue occurring on?
You can inspect the issue only on Chrome

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number:
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): N/A
Logs: N/A
Notes/Photos/Videos:
Expensify/Expensify Issue URL: N/A
Issue reported by: Internal engineer
Slack conversation: https://expensify.slack.com/archives/C05DWUDHVK7/p1693959000958689?thread_ts=1693949572.430099&cid=C05DWUDHVK7

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01be476129f2f20c23
  • Upwork Job ID: 1701078084614434816
  • Last Price Increase: 2023-09-11
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26728805
    • DylanDylann | Contributor | 26728807
@hayata-suenaga hayata-suenaga added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 6, 2023
@hayata-suenaga hayata-suenaga self-assigned this Sep 6, 2023
@hayata-suenaga hayata-suenaga added Weekly KSv2 Engineering and removed Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Sep 6, 2023
@Expensify Expensify deleted a comment from melvin-bot bot Sep 6, 2023
@Expensify Expensify deleted a comment from melvin-bot bot Sep 6, 2023
@neil-marcellini
Copy link
Contributor

Following. I would like to review the PR.

@Nikhil-Vats
Copy link
Contributor

Nikhil-Vats commented Sep 6, 2023

Proposal

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

Delete unfilled waypoints from Onyx data before moving to the confirmation screen

What is the root cause of that problem?

Not a bug, this is an improvement.

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

We need to make a new function in Transaction.js -

function removeEmptyWaypoints(transactionID) {
    const transaction = lodashGet(allTransactions, transactionID, {});
    const existingWaypoints = lodashGet(transaction, 'comment.waypoints', {});
   

    const reIndexedWaypoints = TransactionUtils.getValidWaypoints(existingWaypoints, true);
   

    // Onyx.merge won't remove the null nested object values, this is a workaround
    // to remove nested keys while also preserving other object keys
    // Doing a deep clone of the transaction to avoid mutating the original object and running into a cache issue when using Onyx.set
    const newTransaction = {
        ...transaction,
        comment: {
            ...transaction.comment,
            waypoints: reIndexedWaypoints,
        },
        // Clear the existing route so that we don't show an old route
        routes: {
            route0: {
                geometry: {
                    coordinates: null,
                },
            },
        },
    };
    Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, newTransaction);
}

Then we can call this method on next button press like -

onPress={() => {
    Transaction.removeEmptyWaypoints(iou.transactionID);
    IOU.navigateToNextPage(iou, iouType, reportID, report)
}}

What alternative solutions did you explore? (Optional)

NA

Result -

onyx_waypoint.mp4

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 6, 2023
@Nikhil-Vats
Copy link
Contributor

Hey @hayata-suenaga, I have added a proposal here because I have previously worked on the remove waypoint feature so I knew this functionality in depth. I have also added the video of how it works - when we click next button all the empty waypoints are removed from onyx so if we click back we won't see the empty waypoints. Let me know what you think, I can have a PR ready asap.

@fedirjh
Copy link
Contributor

fedirjh commented Sep 6, 2023

I propose an alternative approach: enhancing the UX by directing them to the waypoint editor instead of inserting empty stops. The user can then add a new waypoint only when they choose a new destination.

CleanShot.2023-09-06.at.20.01.11.mp4

@hayata-suenaga hayata-suenaga added the External Added to denote the issue can be worked on by a contributor label Sep 11, 2023
@melvin-bot melvin-bot bot changed the title Delete unfilled waypoints from Onyx data before moving to the confirmation screen [$500] Delete unfilled waypoints from Onyx data before moving to the confirmation screen Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01be476129f2f20c23

@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@hayata-suenaga
Copy link
Contributor Author

I don't have the bandwidth to open a PR right now, so I'm making this issue external

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@DylanDylann

This comment was marked as outdated.

@DylanDylann
Copy link
Contributor

@0xmiroslav Thanks so much for your reminder. Noted in the future

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

🎯 ⚡️ Woah @0xmiroslav / @DylanDylann, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @DylanDylann got assigned: 2023-09-18 09:29:43 Z
  • when the PR got merged: 2023-09-21 06:34:55 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@jliexpensify
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 21, 2023
@jliexpensify jliexpensify changed the title 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor [PAY ON 27TH SEP] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor Sep 25, 2023
@jliexpensify
Copy link
Contributor

Payment Summary:

  • Contributor: @DylanDylann $500 + $250 (speed bonus)
  • C+: @0xmiroslav $500 + $250 (speed bonus)

Upwork job

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Overdue Daily KSv2 labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title [PAY ON 27TH SEP] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor [HOLD for payment 2023-10-02] [PAY ON 27TH SEP] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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 2023-10-02. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 1, 2023
@jliexpensify jliexpensify changed the title [HOLD for payment 2023-10-02] [PAY ON 27TH SEP] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor [HOLD for payment 2023-10-04] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor Oct 2, 2023
@jliexpensify
Copy link
Contributor

Updated payment date, looks like it was just deployed to prod 3 days ago? Correct me if I am wrong here!

@0xmiros
Copy link
Contributor

0xmiros commented Oct 2, 2023

Deploy date was Sep 25 - #27657 (comment)
2nd post on Sep 27 was from wrong deploy process.

@jliexpensify jliexpensify changed the title [HOLD for payment 2023-10-04] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor [HOLD for payment 2023-10-02] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor Oct 3, 2023
@jliexpensify
Copy link
Contributor

Cheers, paying now.

@0xmiroslav any need for a checklist? Also are you ready tor receive payments yet?

@jliexpensify
Copy link
Contributor

Paid out @DylanDylann

@jliexpensify jliexpensify changed the title [HOLD for payment 2023-10-02] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor [WAITING ON MIROSLAV] [HOLD for payment 2023-10-02] 🟢 [$500] Update 'Add Stop' to directly navigate to the waypoint editor Oct 3, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 5, 2023
@jliexpensify
Copy link
Contributor

Bumpo @0xmiroslav to complete the checklist. Also, do you want me to close this out?

@melvin-bot melvin-bot bot removed the Overdue label Oct 6, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Oct 6, 2023

This is a new feature.

Regression Test Proposal

  1. Go to FAB > Request money
  2. Select Distance tab
  3. Fill Start point and Finish point
  4. Click Add stop
  5. Verify that app redirects to the waypoint editor page
  6. Select address and click Save
  7. Verify that Stop point is added between of Start point and Finish point

@0xmiros
Copy link
Contributor

0xmiros commented Oct 6, 2023

and yes, close this out

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests