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

[C+ Checklist Needs Completion] [$250] Distance - Transaction thread opens after saving distance edit when there is only one request #39457

Closed
6 tasks done
kbecciv opened this issue Apr 2, 2024 · 27 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Apr 2, 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: 1.4.59-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat that has no unsettled request.
  3. Create a distance request.
  4. Click on the request preview to go to one transaction report view.
  5. Click Distance.
  6. Edit the distance and save it.

Expected Result:

App will stay in one transaction report view after saving the distance edit because there is only one request.

Actual Result:

Transaction thread opens after saving distance edit when there is only one request.

Workaround:

n/a

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

Add any screenshot/video evidence

Bug6435985_1712086676590.20240403_033400.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01034c7477c396612a
  • Upwork Job ID: 1776364222315294720
  • Last Price Increase: 2024-04-05
  • Automatic offers:
    • paultsimura | Reviewer | 0
    • bernhardoj | Contributor | 0
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

Copy link
Contributor

github-actions bot commented Apr 2, 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.

@kbecciv
Copy link
Author

kbecciv commented Apr 2, 2024

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

@marcaaron
Copy link
Contributor

I was not able to reproduce this, but ran into another bug:

2024-04-02_14-16-46

A call to GetNewerActions hit a server error. Unsure if related. Checking logs...

{
  "code": 666,
  "jsonCode": 666,
  "type": "Expensify\\Libs\\Error\\ExpError",
  "UUID": "5757c554-3198-11ee-be56-0242ac120002",
  "message": "Missing reportActionID or reportID",
  "title": "",
  "data": [],
  "htmlMessage": "",
  "onyxData": [],
  "requestID": "86e4de6e880ebc79-HNL"
}

@marcaaron
Copy link
Contributor

Ok, tried a second time and could not reproduce that error (worked OK).

Also can't reproduce the issue.

Expected: App will stay in one transaction report view after saving the distance edit because there is only one request.
Actual: Transaction thread opens after saving distance edit when there is only one request.

I'm not really sure what this is trying to communicate. What is a "transaction report" vs. a "transaction thread"?

I'm gonna remove the blocker and have this triaged as a normal bug.

@marcaaron marcaaron added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 3, 2024
@marcaaron marcaaron removed their assignment Apr 3, 2024
@marcaaron marcaaron added the Bug Something is broken. Auto assigns a BugZero manager. label Apr 3, 2024
Copy link

melvin-bot bot commented Apr 3, 2024

Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@bernhardoj
Copy link
Contributor

Proposal

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

Saving the distance waypoints brings the user to the transaction thread.

What is the root cause of that problem?

This happens after the one transaction report page. In the expense report page, we show the money request view and pass transactionThreadReport as the report prop.

{transactionThreadReport && !isEmptyObject(transactionThreadReport) ? (
<>
{transactionCurrency !== report.currency && (
<MoneyReportView
report={report}
policy={policy}
shouldShowHorizontalRule={!shouldHideThreadDividerLine}
/>
)}
<ShowContextMenuContext.Provider value={contextValue}>
<MoneyRequestView
report={transactionThreadReport}
shouldShowHorizontalRule={!shouldHideThreadDividerLine}
shouldShowAnimatedBackground={transactionCurrency === report.currency}
/>
</ShowContextMenuContext.Provider>
</>
) : (

transactionThreadReport is the transaction thread report object. When we open the distance edit page, it will use the passed report reportID and use it as the param.

Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(CONST.IOU.ACTION.EDIT, CONST.IOU.TYPE.REQUEST, transaction?.transactionID ?? '', report.reportID),
)

In distance page, if we were editing, pressing save will call Navigation.dismissModal(reportID)

if (isEditing) {
// If nothing was changed, simply go to transaction thread
// We compare only addresses because numbers are rounded while backup
const oldWaypoints = lodashGet(transactionBackup, 'comment.waypoints', {});
const oldAddresses = _.mapObject(oldWaypoints, (waypoint) => _.pick(waypoint, 'address'));
const addresses = _.mapObject(waypoints, (waypoint) => _.pick(waypoint, 'address'));
if (_.isEqual(oldAddresses, addresses)) {
Navigation.dismissModal(report.reportID);
return;
}
IOU.updateMoneyRequestDistance(transaction.transactionID, report.reportID, waypoints);
Navigation.dismissModal(report.reportID);

and because the reportID is the ID of the transaction thread report, we are navigated to the transaction thread report page.

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

This doesn't happen with other fields (amount, description, etc.) because when we save them, we just call Navigation.dismissModal without a reportID, so I suggest to do the same for distance page.

// If the value hasn't changed, don't request to save changes on the server and just close the modal
if (newAmount === TransactionUtils.getAmount(transaction) && currency === TransactionUtils.getCurrency(transaction)) {
Navigation.dismissModal();
return;
}
if (isSplitBill) {
IOU.setDraftSplitTransaction(transactionID, {amount: newAmount, currency});
Navigation.goBack(backTo);
return;
}
IOU.updateMoneyRequestAmountAndCurrency(transactionID, reportID, currency, newAmount);
Navigation.dismissModal();

What alternative solutions did you explore? (Optional)

We can add a new param to the route to tell which report we want to go after dismissing the modal.

@melvin-bot melvin-bot bot added the Overdue label Apr 5, 2024
@greg-schroeder
Copy link
Contributor

Awaiting proposal review

@melvin-bot melvin-bot bot removed the Overdue label Apr 5, 2024
@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Apr 5, 2024
@melvin-bot melvin-bot bot changed the title Distance - Transaction thread opens after saving distance edit when there is only one request [$250] Distance - Transaction thread opens after saving distance edit when there is only one request Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

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

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

melvin-bot bot commented Apr 5, 2024

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

@greg-schroeder
Copy link
Contributor

Do you mind checking the proposal above @paultsimura? Thanks!

@paultsimura
Copy link
Contributor

Do you mind checking the proposal above @paultsimura? Thanks!

Sure thing, will review it tomorrow 👍

@paultsimura
Copy link
Contributor

The proposal by @bernhardoj looks good to me, thanks for pointing out the logic of the other fields.

🎀👀🎀 C+ reviewed

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

melvin-bot bot commented Apr 8, 2024

📣 @paultsimura 🎉 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 Apr 8, 2024

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

@bernhardoj
Copy link
Contributor

PR is ready

cc: @paultsimura

@greg-schroeder
Copy link
Contributor

Merged and deployed to staging. Awaiting deploy to prod

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 18, 2024
@melvin-bot melvin-bot bot changed the title [$250] Distance - Transaction thread opens after saving distance edit when there is only one request [HOLD for payment 2024-04-25] [$250] Distance - Transaction thread opens after saving distance edit when there is only one request Apr 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

Copy link

melvin-bot bot commented Apr 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.62-17 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-04-25. 🎊

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

Copy link

melvin-bot bot commented Apr 18, 2024

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:

  • [@paultsimura] The PR that introduced the bug has been identified. Link to the PR:
  • [@paultsimura] 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:
  • [@paultsimura] 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:
  • [@paultsimura] Determine if we should create a regression test for this bug.
  • [@paultsimura] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

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

Processing payments

@greg-schroeder greg-schroeder changed the title [HOLD for payment 2024-04-25] [$250] Distance - Transaction thread opens after saving distance edit when there is only one request [C+ Checklist Needs Completion] [$250] Distance - Transaction thread opens after saving distance edit when there is only one request Apr 26, 2024
@greg-schroeder
Copy link
Contributor

Please complete the checklist @paultsimura and we can close this out!

@paultsimura
Copy link
Contributor

My bad, I'm on it!

@paultsimura
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Add One Transaction Report View #36934
  • 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 – It's just a missed piece of logic while implementing the breaking 1-transaction PR
  • 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. Open a policy expense chat with no unsettled expense
  2. Create a new distance request
  3. Press the expense preview to open the one-transaction report page
  4. Click Distance to open the edit distance page
  5. Shuffle the waypoints
  6. Press Save
  7. Verify you are still on the one-transaction report page

Do we agree 👍 or 👎

@greg-schroeder
Copy link
Contributor

Thanks! Filing

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

6 participants