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.14k stars 2.63k forks source link

[HOLD for payment 2024-07-24] [$250] Track distance - Incorrect distance is displayed on confirmation page when submitting to WS #42959

Open kavimuru opened 1 month ago

kavimuru 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: 1.4.78-3 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. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Track a distance expense.
  4. Go to transaction thread of the distance expense.
  5. Take note of the distance.
  6. Return to the main chat.
  7. Click Share it with my accountant (or categorize it) from actionable whisper.
  8. Proceed to confirmation page.

Expected Result:

The distance in the confirmation page will be the same as the distance in the transaction thread because waypoints remain the same.

Actual Result:

The distance in the confirmation page is different. It shows a very short distance (0.01 km in my case).

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

https://github.com/Expensify/App/assets/43996225/b15a76ec-3d48-4b82-b508-1e12b60e6c00

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cae0e715bb61699d
  • Upwork Job ID: 1798854040827421683
  • Last Price Increase: 2024-06-13
  • Automatic offers:
    • situchan | Reviewer | 102737223
    • dominictb | Contributor | 102737226
Issue OwnerCurrent Issue Owner: @lschurr
melvin-bot[bot] commented 1 month ago

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

kavimuru commented 1 month ago

@lschurr 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.

kavimuru commented 1 month ago

We think this bug might be related to #vip-vsb

Tony-MK commented 1 month ago

I tried reproducing on the current main branch, the distance is displayed correctly.

Main

kpadmanabhan commented 1 month ago

Same here. Unable to reproduce in main.

lschurr commented 1 month ago

Going to close since we are unable to reproduce.

lanitochka17 commented 1 month ago

Issue is still reproducible

https://github.com/Expensify/App/assets/78819774/37a969de-1796-46f5-a9f3-588efa86562f

lschurr commented 1 month ago

@Tony-MK @kpadmanabhan - Can you try again?

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~01cae0e715bb61699d

melvin-bot[bot] commented 1 month ago

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

lschurr commented 1 month ago

Would you mind testing and confirming this bug is still happening @situchan? A few others weren't able to reproduce.

situchan commented 1 month ago

testing...

dominictb commented 1 month ago

Proposal

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

The distance in the confirmation page is different. It shows a very short distance (0.01 km in my case).

What is the root cause of that problem?

The GetRouteDraft API returns the comment.customUnit.quantity value of meter unit and then we convert this to the current unit to display here.

But after we create the track distance, back-end returns comment.customUnit.quantity value of the current unit. It leads the distance displays the wrong value when we move the transaction from track expense

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

We should convert the distance to meter value here if we're moving the transaction from track expense by the same as we do here

const distance = isMovingTransactionFromTrackExpense && unit ? DistanceRequestUtils.convertToDistanceInMeters(TransactionUtils.getDistance(transaction), unit) : TransactionUtils.getDistance(transaction);

What alternative solutions did you explore? (Optional)

Tony-MK commented 1 month ago

I have tried to reproduce it on the main branch instead of staging but failed.

This is what I got.

Screenshot 2024-06-07 at 12 50 55

dominictb commented 1 month ago

To reproduce this bug, we should enable P2P distance beta.

melvin-bot[bot] commented 1 month ago

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

situchan commented 1 month ago

reviewing proposal

melvin-bot[bot] commented 1 month ago

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

lschurr commented 1 month ago

Any update on this one @situchan?

situchan commented 1 month ago

I reproduced. @dominictb thanks for the proposal. It makes sense but why can't we fix this inconsistency in backend? One is meter unit, another is current unit.

The GetRouteDraft API returns the comment.customUnit.quantity value of meter unit and then we convert this to the current unit to display here.

But after we create the track distance, back-end returns comment.customUnit.quantity value of the current unit. It leads the distance displays the wrong value when we move the transaction from track expense

dominictb commented 1 month ago

@situchan I think that's expected in back-end that stored the distance value of current unit after we create the distance request. We've been doing that since we got distance from the comment here.

situchan commented 1 month ago

@dominictb's proposal looks good to me. πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

πŸ“£ @situchan πŸŽ‰ 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 1 month ago

πŸ“£ @dominictb πŸŽ‰ 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 πŸ“–

melvin-bot[bot] commented 1 month ago

@thienlnam @lschurr @situchan @dominictb this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

dominictb commented 1 month ago

PR will be ready by a day or two.

melvin-bot[bot] commented 6 days ago

This issue has not been updated in over 15 days. @thienlnam, @lschurr, @situchan, @dominictb eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

melvin-bot[bot] commented 4 hours ago

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

melvin-bot[bot] commented 4 hours ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.7-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-24. :confetti_ball:

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

melvin-bot[bot] commented 4 hours ago

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: