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

[PAY 16TH MAY][$250] Distance - Amount in confirmation page does not update after changing distance #41389

Closed
6 tasks done
izarutskaya opened this issue May 1, 2024 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented May 1, 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.69-0
Reproducible in staging?: Y
Reproducible in production?: N
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 workspace chat.
  3. Go to + > Submit expense > Distance.
  4. Enter waypoints A and B.
  5. Proceed to confirmation page.
  6. Note that the amount is X.
  7. Click Distance.
  8. Add a waypoint C and save it.

Expected Result:

The amount in the distance expense confirmation page will update accordingly.

Actual Result:

The amount in the distance expense confirmation page still shows the previous amount X.

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

Bug6467472_1714543808970.distance_amt.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014927ad327a4ee68d
  • Upwork Job ID: 1785629574758776832
  • Last Price Increase: 2024-05-01
  • Automatic offers:
    • jjcoffee | Reviewer | 0
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

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.

Copy link

melvin-bot bot commented May 1, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 1, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

👋 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.

@izarutskaya
Copy link
Author

@jliexpensify I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@izarutskaya
Copy link
Author

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

@izarutskaya
Copy link
Author

Production

bandicam.2024-05-01.10-04-28-764.mp4

@cretadn22
Copy link
Contributor

cretadn22 commented May 1, 2024

This is regression from this PR #40307

Proposal

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

The amount field isn't updated when updating waypoint list

What is the root cause of that problem?

Presently, when we update the list of waypoints, the amount is reset to zero, after which we proceed to recalculate the amount field

const shouldCalculateDistanceAmount = isDistanceRequest && (iouAmount === 0 || prevRate !== rate);

However, during the recalculation of the amount field, we utilize TransactionUtils.getDistance(transaction) to obtain the distance for computing the amount but the transaction?.comment?.customUnit?.quantity remains unchanged (since it's retrieved from the backend, it requires some time to update), resulting in the amount field not being updated.

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

We additionally require adjusting the quantity whenever there's a modification in the distance.

const shouldCalculateDistanceAmount = isDistanceRequest && (iouAmount === 0 || prevRate !== rate);

Include a condition || prevDistance !== distance to identify when there's a change in distance, allowing us to recalculate the amount accordingly.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@grgia grgia added the External Added to denote the issue can be worked on by a contributor label May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

Job added to Upwork: https://www.upwork.com/jobs/~014927ad327a4ee68d

@melvin-bot melvin-bot bot changed the title Distance - Amount in confirmation page does not update after changing distance [$250] Distance - Amount in confirmation page does not update after changing distance May 1, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 1, 2024
Copy link

melvin-bot bot commented May 1, 2024

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

@grgia grgia added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels May 1, 2024
@jjcoffee
Copy link
Contributor

jjcoffee commented May 1, 2024

@cretadn22's proposal makes sense to me!

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 1, 2024

Current assignee @grgia is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@neil-marcellini
Copy link
Contributor

Ah woops, thanks for finding the problem and a good solution @cretadn22. I'll assign you now to get this moving. @grgia please feel free to re-assign to me, or I'm happy for you to manage it if you prefer.

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

melvin-bot bot commented May 1, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented May 1, 2024

📣 @cretadn22 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

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

@jjcoffee @neil-marcellini I created a PR to fix this bug

@jjcoffee
Copy link
Contributor

jjcoffee commented May 14, 2024

Looks like automation failed here, this hit production May 9, so payment is due May 16. cc @jliexpensify

@jliexpensify jliexpensify changed the title [$250] Distance - Amount in confirmation page does not update after changing distance [PAY 16TH MAY][$250] Distance - Amount in confirmation page does not update after changing distance May 15, 2024
@jliexpensify
Copy link
Contributor

jliexpensify commented May 15, 2024

Thanks @jjcoffee! Does a checklist need to be completed?

Payment Summary

Upwork job

@cretadn22
Copy link
Contributor

cretadn22 commented May 15, 2024

@jliexpensify How about my payment?

@jliexpensify
Copy link
Contributor

@cretadn22 hmm apologies, I didn't see that you were invited to the Upworks job so I assumed you were from one of the agencies.

Are you Nguyen T.?

Can you also add your full name to your GH, so we can easily view and invite you? Thanks!

@cretadn22
Copy link
Contributor

cretadn22 commented May 15, 2024

@jliexpensify Yeah. It is me

@jliexpensify
Copy link
Contributor

Offer sent, please add your name to your GH profile - thanks!

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Get distance from transaction vs route #40307
  • 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: https://github.com/Expensify/App/pull/40307/files#r1601300483
  • 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: N/A
  • Determine if we should create a regression test for this bug. Yes
  • 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 Proposal

  1. Go to any workspace chat
  2. Go to + > Submit expense > Distance.
  3. Enter waypoints A and B.
  4. Proceed to confirmation page.
  5. Note the amount displayed
  6. Click Distance
  7. Add a waypoint C and save it
  8. Confirm that the amount updates correctly on the confirmation screen

Do we agree 👍 or 👎

@neil-marcellini
Copy link
Contributor

Thanks for cleaning up after me! 😅

@jliexpensify
Copy link
Contributor

Paid and job closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants