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.56k stars 2.9k forks source link

[C+ Checklist Needs Completion] [$250] Quick action - Split expense is created in a new group chat when splitting a second time from the same group from global creation #40745

Closed kavimuru closed 6 months ago

kavimuru commented 6 months 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.64-0 Reproducible in staging?: y Reproducible in production?: n If this was caught during regression testing, add the test name, ID and link from TestRail: N/A 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 FAB > Split expense > Manual.
  3. Create manual split expense with two users.
  4. Go to FAB
  5. Click Split expense under Quick action.
  6. Create another split expense.

Expected Result:

The new split expense will be created in the same group chat (production behavior).

Actual Result:

The new split expense is created in a new group chat.

Workaround:

unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/43996225/dab5aa85-bca1-4b58-adf6-a84390f6d92f

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012731ac59083f0155
  • Upwork Job ID: 1782697338779648000
  • Last Price Increase: 2024-04-23
  • Automatic offers:
    • DylanDylann | Reviewer | 0
    • nkdengineer | Contributor | 0
melvin-bot[bot] commented 6 months ago

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.

melvin-bot[bot] commented 6 months ago

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

github-actions[bot] commented 6 months ago

:wave: 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.
kavimuru commented 6 months ago

@MonilBhavsar 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 6 months ago

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

c3024 commented 6 months ago

Is this working correctly on production?

kavimuru commented 6 months ago

On prod, the split is added to the same group chat. On staging, it is added to a new group chat.

melvin-bot[bot] commented 6 months ago

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

melvin-bot[bot] commented 6 months ago

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

mountiny commented 6 months ago

@Gonals can you please have a look? Seems like we might not be saving the correct reportID to the NVP in this case

MonilBhavsar commented 6 months ago

This does seem like a server side issue to me

MonilBhavsar commented 6 months ago

I was wrong. QuickAction NVP seems correct, so client side issue

nkdengineer commented 6 months ago

Proposal

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

The new split expense is created in a new group chat.

What is the root cause of that problem?

When we create split bill via QAB, we're calling splitBillAndOpenReport which will always create a new optimistic report because in this function, we call createSplitsAndOnyxData with existingSplitChatReportID param as empty

https://github.com/Expensify/App/blob/944751fcec525ece0da16a6a4efd80ad8ab4ff8c/src/libs/actions/IOU.ts#L3597

https://github.com/Expensify/App/blob/944751fcec525ece0da16a6a4efd80ad8ab4ff8c/src/pages/iou/request/step/IOURequestStepAmount.tsx#L186

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

In the case we create a split bill via QAB that means the report already exists we should call splitBill function as the same here which already handle this case and also navigate to the correctly report after creating.

https://github.com/Expensify/App/blob/944751fcec525ece0da16a6a4efd80ad8ab4ff8c/src/pages/iou/request/step/IOURequestStepAmount.tsx#L186

We should fix the same for IOURequestStepScan and IOURequestStepDistance page

What alternative solutions did you explore? (Optional)

NA

Gonals commented 6 months ago

@Gonals can you please have a look? Seems like we might not be saving the correct reportID to the NVP in this case

I noticed this bug, but it didn't have anything to do with the QAB (when I tested). It happened for non-QAB flows too 🀷

I'll test again in a bit

Gonals commented 6 months ago

Yep. This happens whenever you try to split again between the same group from global creation, QAB flow or not. Not a blocker

MonilBhavsar commented 6 months ago

Thank you for looking Alberto!

@nkdengineer can you please confirm your proposal for all the split cases

nkdengineer commented 6 months ago

@nkdengineer can you please confirm your proposal for all the split cases

@MonilBhavsar Sure, the bug only happens when we create a split request with skipping the confirmation step (via QAB). So we only need to fix this case as I mentioned in my proposal.

DylanDylann commented 6 months ago

@nkdengineer's proposal looks good to me

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 6 months ago

Current assignee @MonilBhavsar is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 6 months ago

πŸ“£ @DylanDylann πŸŽ‰ 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 6 months ago

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

nkdengineer commented 6 months ago

@DylanDylann The PR is here.

melvin-bot[bot] commented 6 months ago

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

melvin-bot[bot] commented 6 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.66-5 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-05-03. :confetti_ball:

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

melvin-bot[bot] commented 6 months 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:

greg-schroeder commented 6 months ago

Payments made and job closed. @DylanDylann can you take care of the checklist? Thanks!

DylanDylann commented 6 months 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:

[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: https://github.com/Expensify/App/pull/39413 [@DylanDylann] 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/39413#discussion_r1588976721 [@DylanDylann] 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: NA [@DylanDylann] Determine if we should create a regression test for this bug. Yes [@DylanDylann] 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 a group chat
  2. Create a split bill in this group
  3. Go FAB and click on quick action button
  4. Create the split bill again
  5. Verify that the split bill is created in the group chat above

Do we agree πŸ‘ or πŸ‘Ž

MonilBhavsar commented 6 months ago

Looks good, but we might have a regression here https://github.com/Expensify/App/pull/40961#issuecomment-2095565285

nkdengineer commented 6 months ago

@MonilBhavsar I tested and it still works for me on the latest main.

melvin-bot[bot] commented 6 months ago

@greg-schroeder @MonilBhavsar @DylanDylann @nkdengineer 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!

melvin-bot[bot] commented 6 months ago

@greg-schroeder @MonilBhavsar @DylanDylann @nkdengineer 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!

MonilBhavsar commented 6 months ago

tested and it still works for me on the latest main.

πŸ‘ We can close this after creating regression test

greg-schroeder commented 6 months ago

Filing thing, thanks all!