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

[$250] [P2P Distance] Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense #47153

Closed
6 tasks done
IuliiaHerets opened this issue Aug 9, 2024 · 35 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 9, 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: v9.0.18-7
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Workspace has a few distance rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Track expense > Distance.
  4. Proceed to confirmation page.
  5. Click Rate and select a different rate.
  6. Submit the track distance expense.
  7. Go to transaction thread.

Expected Result:

The rate field will show the selected rate in Step 5.

Actual Result:

The rate field reverts to the default rate (0.67 per mile) instead of showing the selected rate in Step 5.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6566522_1723196820658.20240809_174220.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011112cd2e9085ed85
  • Upwork Job ID: 1823303751213013161
  • Last Price Increase: 2024-08-13
  • Automatic offers:
    • jjcoffee | Reviewer | 103538707
    • Krishna2323 | Contributor | 103538708
Issue OwnerCurrent Issue Owner: @dylanexpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 9, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

Triggered auto assignment to @dylanexpensify (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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@IuliiaHerets
Copy link
Author

@dylanexpensify FYI 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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Aug 9, 2024

Proposal

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

Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense

What is the root cause of that problem?

The trackExpense util function does not accept customUnitRateID in the params and the backend does not accept customUnitRateID and build the request accordingly, the backend always returns the default customUnitRateID.

App/src/libs/actions/IOU.ts

Lines 3632 to 3657 in 9812479

function trackExpense(
report: OnyxTypes.Report,
amount: number,
currency: string,
created: string,
merchant: string,
payeeEmail: string | undefined,
payeeAccountID: number,
participant: Participant,
comment: string,
receipt?: Receipt,
category?: string,
tag?: string,
taxCode = '',
taxAmount = 0,
billable?: boolean,
policy?: OnyxEntry<OnyxTypes.Policy>,
policyTagList?: OnyxEntry<OnyxTypes.PolicyTagList>,
policyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>,
gpsPoints?: GPSPoint,
validWaypoints?: WaypointCollection,
action?: IOUAction,
actionableWhisperReportActionID?: string,
linkedTrackedExpenseReportAction?: OnyxTypes.ReportAction,
linkedTrackedExpenseReportID?: string,
) {

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

  • We should modify trackExpense to accept customUnitRateID as param then pass it to the parameters object in trackExpense.
  • The implementation for customUnitRateID will be the same as createDistanceRequest.
  • Then the backend should update the customUnitRateID accordingly.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

@dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@dylanexpensify
Copy link
Contributor

Reviewing today!

@melvin-bot melvin-bot bot removed the Overdue label Aug 13, 2024
@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 13, 2024
@melvin-bot melvin-bot bot changed the title Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense [$250] Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense Aug 13, 2024
Copy link

melvin-bot bot commented Aug 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~011112cd2e9085ed85

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

melvin-bot bot commented Aug 13, 2024

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

@neil-marcellini neil-marcellini changed the title [$250] Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense [$250] [P2P Distance] Track -Rate is always 0.67/mi when a different rate is selected when tracking distance expense Aug 13, 2024
@jjcoffee
Copy link
Contributor

@Krishna2323's proposal makes sense to me. I think it makes sense for trackExpense to support custom distance rates, but I'm not sure if there's a plan already around this so let's get some engineer eyes on this!

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 15, 2024

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

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

melvin-bot bot commented Aug 15, 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 Aug 15, 2024

📣 @Krishna2323 🎉 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 📖

@jjcoffee
Copy link
Contributor

@nkuoch Do you think we can make a BE change to modify trackExpense to accept and use customUnitRateID if we pass it? Currently the BE always returns the default customUnitRateID.

@nkuoch
Copy link
Contributor

nkuoch commented Aug 15, 2024

cc @thienlnam or @neil-marcellini as you originally created TrackExpense command do you think you could make those changes?

@thienlnam
Copy link
Contributor

I probably can't pick it up til end of next week, Neil is more familiar with the distance stuff if he's got free cycles

@neil-marcellini
Copy link
Contributor

I'm also pretty busy at the moment and working 50% this week. I will assign to keep my eyes on this though and try to prioritize it soon.

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 23, 2024
@Krishna2323
Copy link
Contributor

Krishna2323 commented Sep 3, 2024

@neil-marcellini, sorry I couldn't keep track of this as I was unassigned. I see you have raised the PR for the front-end as well. Am I still eligible for compensation since my proposal was selected, and we also needed to make changes to the front-end?

@neil-marcellini
Copy link
Contributor

@Krishna2323 I've chosen to implement the frontend changes myself because it makes it easy for me to test the whole flow against my backend changes. The changes are also very simple on the frontend so it doesn't make sense to pay for your proposal in this case. That's why I never assigned you or reviewed the proposal. Next time I'll try to remember to remove the Help Wanted label early on.

@neil-marcellini neil-marcellini removed the Reviewing Has a PR in review label Sep 4, 2024
@neil-marcellini
Copy link
Contributor

Backend changes are live, but C+ encountered issues testing so I need to investigate and fix that.

@neil-marcellini
Copy link
Contributor

The issue happened on main too and was unrelated so the PR has been merged.

@jjcoffee
Copy link
Contributor

Looks like the automation failed again! This hit production 2024-09-09, so this should be held for payment 2024-09-16. cc @dylanexpensify

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
@neil-marcellini neil-marcellini added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 16, 2024
@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A - feature was not implemented
  • 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: N/A
  • 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 that has a few different distance rates set up.
  2. Click + > Track expense > Distance.
  3. Proceed to confirmation page.
  4. Click Rate and select a different rate (i.e. not the default 0.67/mi).
  5. Submit the track distance expense.
  6. Go to the transaction thread.
  7. Verify the custom rate is displayed.

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@dylanexpensify Friendly bump for payment (see this comment for deploy deetz) 🙇

@dylanexpensify
Copy link
Contributor

Payment summary:

Contributor+: @jjcoffee $250

Please apply/request!

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2024
@dylanexpensify
Copy link
Contributor

@jjcoffee job post here!

@jjcoffee
Copy link
Contributor

@dylanexpensify Thanks, applied!

@jjcoffee
Copy link
Contributor

@dylanexpensify Friendly bump for payment 🙇

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 23, 2024
@dylanexpensify
Copy link
Contributor

Working on this - Upwork is a bit buggy right now!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 25, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

@neil-marcellini, @jjcoffee, @dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Oct 2, 2024

@neil-marcellini, @jjcoffee, @dylanexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@neil-marcellini
Copy link
Contributor

Bump @dylanexpensify

@dylanexpensify
Copy link
Contributor

done!

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. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff
Projects
Status: Done
Development

No branches or pull requests

7 participants