Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.33k stars 2.76k forks source link

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

Open IuliiaHerets opened 1 month ago

IuliiaHerets commented 1 month ago

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:

  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:

Screenshots/Videos

https://github.com/user-attachments/assets/de6fc7b0-eb8c-43c6-a59e-608b22127bcd

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: @neil-marcellini
melvin-bot[bot] commented 1 month ago

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 commented 1 month ago

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

IuliiaHerets commented 1 month ago

@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 commented 1 month ago

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. https://github.com/Expensify/App/blob/98124799a639606573877bf6eb38554ee2939a22/src/libs/actions/IOU.ts#L3632-L3657

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

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 1 month ago

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

dylanexpensify commented 1 month ago

Reviewing today!

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

jjcoffee commented 4 weeks ago

@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!

:ribbon::eyes::ribbon: C+ reviewed

melvin-bot[bot] commented 4 weeks ago

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

melvin-bot[bot] commented 4 weeks ago

πŸ“£ @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

melvin-bot[bot] commented 4 weeks ago

πŸ“£ @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 commented 4 weeks ago

@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 commented 4 weeks ago

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

thienlnam commented 3 weeks ago

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 commented 3 weeks ago

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.

neil-marcellini commented 3 weeks ago

Still haven't gotten to this, but hopefully before EOW.

neil-marcellini commented 3 weeks ago

I'm starting on this now

neil-marcellini commented 3 weeks ago

PRs are up for review!

Krishna2323 commented 1 week ago

@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 commented 1 week ago

@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 commented 1 week ago

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

neil-marcellini commented 1 week ago

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

jjcoffee commented 2 days ago

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