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-08-19] [$250] Track expense - App throws error when submitting track distance expense #47042

Closed
6 tasks done
IuliiaHerets opened this issue Aug 8, 2024 · 30 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

@IuliiaHerets
Copy link

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Click + > Track expense > Distance.
  4. Submit a track distance expense.

Expected Result:

The track distance expense will be created successfully.

Actual Result:

App throws error when submitting track distance expense - There is a previously existing chat between these users.

Workaround:

Uncnown

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

Bug6565175_1723084027231.20240808_102342.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018888d22189418e67
  • Upwork Job ID: 1821495281651751011
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • jjcoffee | Reviewer | 103448882
    • dominictb | Contributor | 103448883
Issue OwnerCurrent Issue Owner: @stephanieelliott
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

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

Copy link

melvin-bot bot commented Aug 8, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 8, 2024
Copy link
Contributor

github-actions bot commented Aug 8, 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.

@IuliiaHerets
Copy link
Author

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

@pecanoro
Copy link
Contributor

pecanoro commented Aug 8, 2024

I can reproduce but if it's not coming from the back-end, I am wondering if we changed the API request in some PR, looking!

image

@pecanoro
Copy link
Contributor

pecanoro commented Aug 8, 2024

Oh, on production we call TrackExpense and we call CreateDistanceRequest on staging

image

image

@pecanoro pecanoro mentioned this issue Aug 8, 2024
58 tasks
@pecanoro
Copy link
Contributor

pecanoro commented Aug 8, 2024

It's coming from this PR: #42302

@pecanoro pecanoro removed the DeployBlocker Indicates it should block deploying the API label Aug 8, 2024
@pecanoro
Copy link
Contributor

pecanoro commented Aug 8, 2024

I am going to open it for proposals since everyone involved in the original PR is not online and if we don't get any, I will revert the original PR.

@pecanoro pecanoro added the External Added to denote the issue can be worked on by a contributor label Aug 8, 2024
@melvin-bot melvin-bot bot changed the title Track expense - App throws error when submitting track distance expense [$250] Track expense - App throws error when submitting track distance expense Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

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

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

melvin-bot bot commented Aug 8, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Aug 8, 2024

Edited by proposal-police: This proposal was edited at 2024-08-08 11:42:06 UTC.

@pecanoro I can raise the PR asap to fix this

Proposal

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

App throws error when submitting track distance expense - There is a previously existing chat between these users.

What is the root cause of that problem?

In the PR #42302, we mistakenly moved the createDistanceRequest(iouType == condition to the top (this change https://github.com/Expensify/App/pull/42302/files#diff-5e5fc302dd5db871d26e30f810bc0606beccb7f50ae6ed6535cd93aaee98c280), causing it to be evaluated first and not trackExpense, so it calls CreateDistanceRequest in track distance expense case instead of TrackExpense

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

Move this block back to its correct location before the PR which is here

What alternative solutions did you explore? (Optional)

Update this block to

if (iouType !== CONST.IOU.TYPE.TRACK && isDistanceRequest && !isMovingTransactionFromTrackExpense) {
                createDistanceRequest(iouType === CONST.IOU.TYPE.SPLIT ? splitParticipants : selectedParticipants, trimmedComment);
                return;
            }

So it will only createDistanceRequest if it's not a track expense, we can extend the iouType check for other iou types if needed (if there're other IOU types that should not call createDistanceRequest but uses its own method, like track expense)

@dominictb
Copy link
Contributor

Proposal updated to add alternative approach

@jjcoffee
Copy link
Contributor

jjcoffee commented Aug 8, 2024

Hmm, I don't think we can just move createDistanceRequest back down as that would most likely cause a regression from #42302 since we'd call IOU.splitBill first and return early instead of creating the distance request for splitting.

I wonder if we also need to handle !isMovingTransactionFromTrackExpense covers the other conditions that result in calling trackExpense:

if (iouType === CONST.IOU.TYPE.TRACK || isCategorizingTrackExpense || isSharingTrackExpense) {

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

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

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

@dominictb
Copy link
Contributor

Thanks 🙏 On it now

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Aug 8, 2024
@dominictb
Copy link
Contributor

@jjcoffee The PR is ready.

@mvtglobally
Copy link

Looks resolved

Recording.663.mp4

@pecanoro
Copy link
Contributor

pecanoro commented Aug 8, 2024

Awesome, thank you! Removing deploy blocker

@pecanoro pecanoro removed the DeployBlockerCash This issue or pull request should block deployment label Aug 8, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 12, 2024
@melvin-bot melvin-bot bot changed the title [$250] Track expense - App throws error when submitting track distance expense [HOLD for payment 2024-08-19] [$250] Track expense - App throws error when submitting track distance expense Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.18-10 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-08-19. 🎊

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

Copy link

melvin-bot bot commented Aug 12, 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:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
  • [@jjcoffee] 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:
  • [@jjcoffee] 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:
  • [@jjcoffee] Determine if we should create a regression test for this bug.
  • [@jjcoffee] 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.
  • [@stephanieelliott] 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 Overdue and removed Weekly KSv2 labels Aug 18, 2024
@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

  • Contributor: @dominictb $250 via Upwork - PAID
  • Contributor+: @jjcoffee $250 via Upwork - PAID

Upwork job is here: https://www.upwork.com/jobs/~018888d22189418e67

@melvin-bot melvin-bot bot removed the Overdue label Aug 20, 2024
@stephanieelliott
Copy link
Contributor

Hey @jjcoffee can you please complete the BZ checklist for this when you get a sec?

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Enable distance splits #42302
  • 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: https://github.com/Expensify/App/pull/42302/files#r1723447110
  • 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 - should've been caught in checklist
  • Determine if we should create a regression test for this bug. Yes - although one most likely already exists
  • 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 self DM.
  2. Click + > Track expense > Distance.
  3. Submit a track distance expense.
  4. Verify that the expense shows up with no errors.

Do we agree 👍 or 👎

@stephanieelliott
Copy link
Contributor

Test case created! https://github.com/Expensify/Expensify/issues/422130

All done here, thanks!

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
None yet
Development

No branches or pull requests

6 participants