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

[HOLD for payment 2024-11-14] [$250] Track distance - Distance and Rate show “Pending” when tracking via Just track it route #51679

Closed
4 of 8 tasks
lanitochka17 opened this issue Oct 29, 2024 · 21 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 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 29, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.55-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Account has no expense
  1. Go to staging.new.expensify.com
  2. Go to Search
  3. Click Create expense
  4. Go to Distance
  5. Enter waypoints > Next
  6. Click Just track it

Expected Result:

Distance and Rate will show the correct distance and rate when tracking via Just track it route

Actual Result:

Distance and Rate show “Pending” when tracking via Just track it route

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6649481_1730217378679.20241029_235412.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851378732093417344
  • Upwork Job ID: 1851378732093417344
  • Last Price Increase: 2024-10-29
  • Automatic offers:
    • nkdengineer | Contributor | 104720899
Issue OwnerCurrent Issue Owner: @greg-schroeder
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 29, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

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

@lanitochka17
Copy link
Author

@greg-schroeder 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

@nkdengineer
Copy link
Contributor

nkdengineer commented Oct 29, 2024

Edited by proposal-police: This proposal was edited at 2024-10-29 18:55:18 UTC.

Proposal

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

Distance and Rate show “Pending” when tracking via Just track it route

What is the root cause of that problem?

When we click on Just track it, we don't set the customUnitRateID as we do here

IOU.setMoneyRequestParticipantsFromReport(transactionID, ReportUtils.getReport(selfDMReportID));

Then the mileageRate in the confirmation page here is undefined based on this logic

Which causes isDistanceRequestWithPendingRoute is true

const isDistanceRequestWithPendingRoute = isDistanceRequest && (!hasRoute || !rate) && !isMovingTransactionFromTrackExpense;

and waypoints pendingField is added as add which makes Pending... is displayed for distance and rate field

useEffect(() => {
if (!isDistanceRequest || isMovingTransactionFromTrackExpense) {
return;
}
/*
Set pending waypoints based on the route status. We should handle this dynamically to cover cases such as:
When the user completes the initial steps of the IOU flow offline and then goes online on the confirmation page.
In this scenario, the route will be fetched from the server, and the waypoints will no longer be pending.
*/
IOU.setMoneyRequestPendingFields(transactionID, {waypoints: isDistanceRequestWithPendingRoute ? CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD : null});
const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate ?? 0, currency ?? CONST.CURRENCY.USD, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant(transactionID, distanceMerchant, true);
}, [

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

We should update the customUnitRateID when we click on Just track it button here. Optionally, we can only do it if the request is distance request.

const rateID = DistanceRequestUtils.getCustomUnitRateID(selfDMReportID, !canUseP2PDistanceRequests);
IOU.setCustomUnitRateID(transactionID, rateID);

IOU.setMoneyRequestParticipantsFromReport(transactionID, ReportUtils.getReport(selfDMReportID));

OPTIONAL: We can also update the reportID of the draft transaction to selfDMReportID

What alternative solutions did you explore? (Optional)

We can do this logic inside setMoneyRequestParticipantsFromReport function

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Oct 29, 2024
@melvin-bot melvin-bot bot changed the title Track distance - Distance and Rate show “Pending” when tracking via Just track it route [$250] Track distance - Distance and Rate show “Pending” when tracking via Just track it route Oct 29, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

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

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

melvin-bot bot commented Oct 29, 2024

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

@s77rt
Copy link
Contributor

s77rt commented Oct 30, 2024

@nkdengineer Thanks for the proposal. Your RCA makes sense. Do you know at what stage we set the comment.customUnit.customUnitRateID when using the FAB Track Expense option?

@nkdengineer
Copy link
Contributor

@s77rt When using FAB Track expense the customUnitRateID is updated here.

App/src/libs/actions/IOU.ts

Lines 352 to 354 in a4c8de6

if (!isFromGlobalCreate) {
const customUnitRateID = DistanceRequestUtils.getCustomUnitRateID(reportID);
comment.customUnit = {customUnitRateID};

@s77rt
Copy link
Contributor

s77rt commented Oct 30, 2024

@nkdengineer Got it! Thanks! The proposed solution looks good to me.

🎀 👀 🎀 C+ reviewed
Link to proposal

Copy link

melvin-bot bot commented Oct 30, 2024

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

@nkdengineer
Copy link
Contributor

@robertjchen Please take a look when you have a chance.

@robertjchen
Copy link
Contributor

👍 to proposal!

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

melvin-bot bot commented Nov 3, 2024

📣 @nkdengineer 🎉 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 melvin-bot bot removed the Overdue label Nov 3, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Nov 4, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Nov 7, 2024
@melvin-bot melvin-bot bot changed the title [$250] Track distance - Distance and Rate show “Pending” when tracking via Just track it route [HOLD for payment 2024-11-14] [$250] Track distance - Distance and Rate show “Pending” when tracking via Just track it route Nov 7, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 7, 2024
Copy link

melvin-bot bot commented Nov 7, 2024

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

Copy link

melvin-bot bot commented Nov 7, 2024

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

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

Copy link

melvin-bot bot commented Nov 7, 2024

@s77rt @greg-schroeder The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@s77rt
Copy link
Contributor

s77rt commented Nov 10, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: [A/B Testing - Create Expense] Implement Create Expense Flow under hidden Beta #49007 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • Account has no expenses

Test:

  1. Go to Search > Expenses
  2. Click Create expense
  3. Choose Distance and select waypoints then click on Next
  4. Click Just track it
  5. Verify that all the fields display the correct values and none is "Pending"

Do we agree 👍 or 👎

@greg-schroeder
Copy link
Contributor

Thanks @s77rt! Looks like we're set to go for 11/14

@s77rt
Copy link
Contributor

s77rt commented Nov 11, 2024

@greg-schroeder I think you still need to create a GH issue for the testrail test

@greg-schroeder
Copy link
Contributor

Yeah of course. I'll file it after I pay this on 11/14

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 14, 2024
@greg-schroeder
Copy link
Contributor

Payment summary:

Contributor: @nkdengineer - $250 - Upwork
C+: @s77rt - $250 - NewDot manual request

@JmillsExpensify
Copy link

$250 approved for @s77rt

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 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

6 participants