Skip to content

[HOLD for payment 2024-03-07] [$500] Web - Distance -When adding 'Stop' location the newly added location is added to 'Finish' location #36067

Closed

Description

@kbecciv

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: v1.4.38-1
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. Click on 'FAB'
  2. Click on 'Request money' > 'Distance' tab
  3. Add 'Start' & 'Finish' location
  4. Click on 'Add stop' & add location

Expected Result:

The newly added 'Stop' location should be added to 'Stop' section of 'Request money' page

Actual Result:

The newly added 'Stop' location is added to 'Finish' section

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

Bug6370800_1707332474121.Screen_Recording_2024-02-07_at_2.24.00_in_the_afternoon.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ef55b7f820f1f8da
  • Upwork Job ID: 1755312140866273280
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • codinggeek2023 | Contributor | 0

Activity

  1. added
    External
    Daily
    Bug
    on Feb 7, 2024
  2. changed the title [-]Web - Distance -When adding 'Stop' location the newly added location is added to 'Finish' location[/-] [+][$500] Web - Distance -When adding 'Stop' location the newly added location is added to 'Finish' location[/+] on Feb 7, 2024
  3. melvin-bot commented on Feb 7, 2024

    @melvin-bot
  4. added
    Help Wanted
    on Feb 7, 2024
  5. melvin-bot commented on Feb 7, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 7, 2024

    @melvin-bot

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

  7. kbecciv commented on Feb 7, 2024

    @kbecciv
    Author

    We think that this bug might be related #wave5-free-submitters
    CC @dylanexpensify

  8. muas19 commented on Feb 7, 2024

    @muas19

    Proposal

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

    When adding 'Stop' location the newly added location is added to 'Finish' location

    What is the root cause of that problem?

    UI/UX could be confusing because the CTA button reads "+ Add Stop", and on the waypoint list, we have a "Stop" entry. By default, when the user taps the CTA button, the new address gets added to the end of the list which reads "Finish".

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

    We could make the CTA button Waypoint list in the location chooser read "Stop" instead of Finish.

    finish: 'Finish',
    finish: 'Stop',

    Or could add the new waypoint just before the last one.

    What alternative solutions did you explore? (Optional)

    Get feedback from UI team if this makes sense.

  9. abzokhattab commented on Feb 7, 2024

    @abzokhattab
    Contributor

    Proposal

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

    When adding 'Stop' location the newly added location is added to 'Finish' location

    What is the root cause of that problem?

    when adding a new stop it gets added to the end of the waypoints array and here if we have 3 waypoints we mark the the second waypoint as the stop and the third one as the Finish

    const waypointDescriptionKey = useMemo(() => {
    switch (parsedWaypointIndex) {
    case 0:
    return 'distance.waypointDescription.start';
    case waypointCount - 1:
    return 'distance.waypointDescription.finish';
    default:
    return 'distance.waypointDescription.stop';
    }
    }, [parsedWaypointIndex, waypointCount]);

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

    we need to swap the finish with the stop

  10. muas19 commented on Feb 7, 2024

    @muas19
  11. rojiphil commented on Feb 8, 2024

    @rojiphil
    Contributor

    Proposal

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

    In distance requests, adding Stop location is getting added to the Finish location instead of the Stop location.

    What is the root cause of that problem?

    As I understand, the implementation of adding the newly added stop as the last one i.e. as Finish is intentional. However, I think the confusion arises because of the word stop been used in [1] and [2] in clash with word Finish [3] as shown below. Because of this, the user may expect the Add stop to add a waypoint under Stop and not to the `Finish. This, I think, is the root cause.

    As discussed here, I took the lead in identifying the root cause and in arriving at the desired approach.

    Screenshot 2024-02-09 at 12 31 10 AM

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

    We can solve this by making the following 4 changes:

    1. Remove the finish waypoint description key and simplify by using a simple if statement like this:
            if(parsedWaypointIndex === 0) {
                return 'distance.waypointDescription.start';
            } else {
                return 'distance.waypointDescription.stop';
            }
    
    1. Change the following render implementation here with the following to do away with finish. As discussed here, we can use Location icon here. And, DotIndicator for start.
        if (index === 0) {
            descriptionKey += 'start';
            waypointIcon = Expensicons.DotIndicator;
        } else {
            descriptionKey += 'stop';
            waypointIcon = Expensicons.Location;
        }
    

    Similarly, we need to change the icons here and here like this

                        if (index === 0) {
                            MarkerComponent = Expensicons.DotIndicator;
                        } else {
                            MarkerComponent = Expensicons.Location;
                        }
    
    1. Remove the finish key present in DistanceEReceipt here
       -                         } else if (index === _.size(waypoints) - 1) {
       -                             descriptionKey += 'finish';
    
    1. Remove the translations for finish waypoint description from here and here

    What alternative solutions did you explore? (Optional)

    Replace Finish (i.e. [3]) with Stop. This was discussed in slack here. We can do this by replacing Finish with Stop here like this:

    finish: 'Stop',

  12. 59 remaining items

  13. melvin-bot commented on Feb 29, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.45-6 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-07. 🎊

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

  14. melvin-bot commented on Feb 29, 2024

    @melvin-bot

    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:

    • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
    • [@sobitneupane] 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:
    • [@sobitneupane] 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:
    • [@sobitneupane] Determine if we should create a regression test for this bug.
    • [@sobitneupane] 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.
    • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/376660
  15. sobitneupane commented on Mar 6, 2024

    @sobitneupane
    Contributor

    Regression Test Proposal:

    1. Click on 'FAB'
    2. Click on 'Request money' > 'Distance' tab
    3. Add 'Start' & 'Stop' location
    4. Click on 'Add stop' & add location
    5. Verify that the new waypoint is displayed with the title "Stop"
  16. kadiealexander commented on Mar 7, 2024

    @kadiealexander
    Contributor

    Payouts due:

    • Contributor: $500 @codinggeek2023
    • Contributor+: $500 @sobitneupane

    Upwork job is here.

  17. added
    Daily
    and removed
    Weekly
    on Mar 7, 2024
  18. added
    Daily
    and removed
    Daily
    on Mar 7, 2024
  19. kadiealexander commented on Mar 8, 2024

    @kadiealexander
    Contributor

    @sobitneupane could you please complete the rest of the checklist?

    • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
    • [@sobitneupane] 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:
    • [@sobitneupane] 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:
  20. sobitneupane commented on Mar 8, 2024

    @sobitneupane
    Contributor

    @kadiealexander Rather than a bug, I would say its an improvement on the app. Before it was designed to show Start, Stop and Finish. Now, we have updated it to show Start and Stop only.

  21. kadiealexander commented on Mar 10, 2024

    @kadiealexander
    Contributor

    Sweet, please request payment via NewDot.

  22. JmillsExpensify commented on Mar 22, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @sobitneupane based on summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions