Skip to content

[HOLD for payment 2024-08-14] [$250] Distance - "Add stop" button is shown when Start and Stop points are empty #45467

Closed

Description

@izarutskaya

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: 9.0.7-4
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4723510
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Submit expense.
  3. Go to Distance.

Expected Result:

There will not be "Add stop" button when Start and Stop points are empty (production behavior).

Actual Result:

"Add stop" button is shown when Start and Stop points are empty.

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

Bug6543537_1721112409072.20240716_144514.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c728763e9a6c40ec
  • Upwork Job ID: 1818743058888345786
  • Last Price Increase: 2024-07-31
  • Automatic offers:
    • akinwale | Reviewer | 103347058
Issue OwnerCurrent Issue Owner: @jliexpensify

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Jul 16, 2024
  2. melvin-bot commented on Jul 16, 2024

    @melvin-bot

    Triggered auto assignment to @nkuoch (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Jul 16, 2024

    @melvin-bot

    Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  4. github-actions commented on Jul 16, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. izarutskaya commented on Jul 16, 2024

    @izarutskaya
    Author

    We think this issue might be related to the #collect project.

  6. etCoderDysto commented on Jul 16, 2024

    @etCoderDysto
    Contributor

    Proposal

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

    "Add stop" button is shown when Start and Stop points are empty

    What is the root cause of that problem?

    • We display 'Add stop' button when numberOfFilledWaypoints >= 2
      {numberOfFilledWaypoints >= 2 && (
      <View style={[styles.flexRow, styles.justifyContentCenter, styles.pt1]}>
      <Button
    • Since an empty waypoint has a default keyForList key, the filter method returns an arrary of length 2 and numberOfFilledWaypoints is calculated to be 2 when two or more waypoints are not selected.
      `Object.keys(waypoint).length``
      const numberOfFilledWaypoints = Object.values(waypoints ?? {}).filter((waypoint) => Object.keys(waypoint).length).length;

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

    We should check in the filter if waypoints key length is greater that one to check if a waypoint is selected. When a waypoint is selected, waypoint object will have address, lat, lng, name, and keyForList keys.

    const numberOfFilledWaypoints = Object.values(waypoints ?? {}).filter((waypoint) => Object.keys(waypoint).length > 1).length;

    What alternative solutions did you explore? (Optional)

    We can also use address prop on waypoint object to check if a waypoint is selected

    const numberOfFilledWaypoints = Object.values(waypoints ?? {}).filter((waypoint) => Object.keys(waypoint).address).length;

    Result:
    image

  7. etCoderDysto commented on Jul 16, 2024

    @etCoderDysto
    Contributor

    Proposal updated:

    • Added result
  8. 42 remaining items

  9. added
    Awaiting Payment
    on Aug 7, 2024
  10. changed the title [-][$250] Distance - "Add stop" button is shown when Start and Stop points are empty[/-] [+][HOLD for payment 2024-08-14] [$250] Distance - "Add stop" button is shown when Start and Stop points are empty[/+] on Aug 7, 2024
  11. melvin-bot commented on Aug 7, 2024

    @melvin-bot

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

  12. removed
    Reviewing
    on Aug 7, 2024
  13. melvin-bot commented on Aug 7, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 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-08-14. 🎊

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

  14. melvin-bot commented on Aug 7, 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:

    • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
    • [@akinwale] 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:
    • [@akinwale] 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:
    • [@akinwale] Determine if we should create a regression test for this bug.
    • [@akinwale] 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.
    • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  15. akinwale commented on Aug 14, 2024

    @akinwale
    Contributor
    • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
    • [@akinwale] 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:
    • [@akinwale] 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:

    This was a regression from #44748. Comment.

    • [@akinwale] Determine if we should create a regression test for this bug.
    • [@akinwale] 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.

    Regression Test Steps

    1. Launch Expensify.
    2. Click on the FAB and select Submit expense.
    3. Switch to the Distance tab if not already active.
    4. Verify that the Add stop button is not displayed.
    5. Select start and stop waypoints.
    6. Verify that the Add stop button is displayed.

    Do we agree 👍 or 👎?

  16. jliexpensify commented on Aug 14, 2024

    @jliexpensify
    Contributor

    @etCoderDysto can you add your Upworks name to your GH profile please? It would help greatly so we can easily find you, thanks!

  17. jliexpensify commented on Aug 14, 2024

    @jliexpensify
    Contributor

    Payment Summary

    C: @etCoderDysto $250
    C+: @akinwale $250

    Upwork job

  18. jliexpensify commented on Aug 14, 2024

    @jliexpensify
    Contributor

    Thank you, hired!

  19. etCoderDysto commented on Aug 14, 2024

    @etCoderDysto
    Contributor

    Thank you, hired!

    I have accepted the offer. Thank you!

  20. added
    Daily
    and removed
    Weekly
    on Aug 14, 2024
  21. jliexpensify commented on Aug 15, 2024

    @jliexpensify
    Contributor

    Everyone's paid and job closed, cheers!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions