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-14] [$250] [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected #46339

Closed
1 of 6 tasks
m-natarajan opened this issue Jul 27, 2024 · 33 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

@m-natarajan
Copy link

m-natarajan commented Jul 27, 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: 9.0.13-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: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1722037742346479

Action Performed:

  1. User A submits an IOU to User B
  2. User B selects option "Pay with expensify"
  3. Select option "business bank account"
  4. Observe the LHN

Expected Result:

A new workspace created and moved the IOU to "expense report" for the payer and user redirected to workspace chat

Actual Result:

Workspace created , Not redirected to workspace chat and not converting the IOU to an expense report

Workaround:

Unknown

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

Screen.Recording.2024-07-26.at.4.52.15.PM.mov

image (2)

Recording.389.mp4

Logs.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f077fda3c01ec8f0
  • Upwork Job ID: 1818013143723474571
  • Last Price Increase: 2024-07-29
  • Automatic offers:
    • gijoe0295 | Contributor | 103331425
Issue OwnerCurrent Issue Owner: @trjExpensify
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 27, 2024
Copy link

melvin-bot bot commented Jul 27, 2024

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.

@gijoe0295
Copy link
Contributor

gijoe0295 commented Jul 27, 2024

Proposal

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

In bottom-up flow, after paying with Expensify using Business bank account, a new workspace created but:

  1. Not redirected to workspace chat
  2. Not converting the IOU to an expense report

What is the root cause of that problem?

For 2, I could not reproduce it, the IOU is indeed converted to a new expense report inside the newly created workspace. We can easily see that in QA's second video at 0:46:

  • The initial $10.00 IOU disappeared in the DM and a message said moved the report to...
  • The fourth chat in LHN said Applause's Workspace owes $10.00

For 1, we does not navigate to the workspace chat after creation, just navigate to the add bank account page:

} else if (paymentMethod === CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT) {
if (iouReport && ReportUtils.isIOUReport(iouReport)) {
const policyID = Policy.createWorkspaceFromIOUPayment(iouReport);
// Navigate to the bank account set up flow for this specific policy
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute('', policyID));
return;
}
Navigation.navigate(addBankAccountRoute);
}

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

  1. Return the newly created employee workspace chat ID from this function:

function createWorkspaceFromIOUPayment(iouReport: OnyxEntry<Report>): string | undefined {

  1. Then navigate to that workspace chat

  2. Optionally, we could highlight the newly expense report preview action within that workspace chat by returning the report preview action ID:

// We need to move the report preview action from the DM to the workspace chat.
const reportPreview = ReportActionsUtils.getParentReportAction(iouReport);

So when Business bank account is selected here, add this snippet:

const {policyID, workspaceChatReportID, reportPreviewReportActionID} = Policy.createWorkspaceFromIOUPayment(iouReport) ?? {};

if (workspaceChatReportID) {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID));
}

Screenshots

navigate-to-workspace.mov

RHP opens on top of Workspace chat

Screenshot 2024-07-30 at 03 46 21

The workspace chat is GBR'ed right away

Screenshot 2024-07-30 at 03 46 31

@gijoe0295
Copy link
Contributor

gijoe0295 commented Jul 27, 2024

Proposal Updated

  • Prettify proposal
  • Add details to root cause analysis

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@trjExpensify trjExpensify changed the title [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected Jul 29, 2024
@trjExpensify trjExpensify moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #wave-collect Jul 29, 2024
@trjExpensify
Copy link
Contributor

Confirming a couple of things in thread.

In the meantime, @gijoe0295 can you include a video of your proposal above to check the expected results? Thanks!

@trjExpensify trjExpensify assigned trjExpensify and unassigned lschurr Jul 29, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jul 29, 2024
@trjExpensify
Copy link
Contributor

Okay, so sounds like the two items to look at here are:

  • Redirect to the workspace chat when clicking the “Pay with business bank account” button option right away when we create the workspace, and open the add bank account page in the RHP of the workspace chat not the DM.
  • Make sure the workspace chat with the converted expense report is GBR’d right away, it doesn't require a click into the report preview for it to appear on the workspace chat row in the LHN.

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot changed the title [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected [$250] [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected Jul 29, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@trjExpensify
Copy link
Contributor

@mananjadhav can you jump on that proposal review, please? We'd love to get this one turned around ASAP. Thanks!

@gijoe0295
Copy link
Contributor

@trjExpensify @mananjadhav Added screenshots to my proposal. My initial proposal addresses all the latest expectations #46339 (comment).

@gijoe0295
Copy link
Contributor

Note that we have a regression from #46323 where Business Bank Account is always selected when selecting Pay with Expensify:

// We temporarily disabled P2P debit cards so we will automatically select the personal bank account option if there is no other option to select.
useEffect(() => {
if (!isVisible) {
return;
}
onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT);
}, [isPersonalOnlyOption, isVisible, onItemSelected]);

The condition should be !isVisible || !isPersonalOnlyOption. In order to test this flow, please modify that way.

@trjExpensify
Copy link
Contributor

^^ @marcaaron given the context on that PR that deployed a few hours ago, checking you're okay with that change.

For the bottom-up flow, both of these options should be retained:

image

Copy link

melvin-bot bot commented Jul 30, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mananjadhav
Copy link
Collaborator

@gijoe0295 's proposal looks good to me.

🎀 👀 🎀 C+ reviewed.

Copy link

melvin-bot bot commented Jul 30, 2024

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

@gijoe0295
Copy link
Contributor

PR ready in 3 hours.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 31, 2024
@trjExpensify trjExpensify moved this from Release 2: Summer 2024 (Aug) to Release 2.5: SuiteWorld (Sept 9th) in [#whatsnext] #wave-collect Aug 6, 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 7, 2024
@melvin-bot melvin-bot bot changed the title [$250] [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected [HOLD for payment 2024-08-14] [$250] [CVP] [Critical] Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected Aug 7, 2024
Copy link

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

melvin-bot bot commented Aug 7, 2024

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

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

Copy link

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

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented Aug 14, 2024

@trjExpensify Before summarizing payment I wonder if I'm eligible for payments for #46490 since I posted a working solution being used in the PR.

@trjExpensify
Copy link
Contributor

Yeah, we ended up doing two PRs in the end to clear that blocker?

@gijoe0295
Copy link
Contributor

gijoe0295 commented Aug 14, 2024

@trjExpensify That's correct. And the blocker's PR was implemented by @mananjadhav.

@mananjadhav
Copy link
Collaborator

@trjExpensify We implemented two PRs - one for this blocker which I wrote and the second one for another issue that this PR @gijoe0295 wrote.

But yeah I agree they posted the solution before I implemented in the comments. I implemented it unblock the release.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 14, 2024
@trjExpensify
Copy link
Contributor

Cool, so I'll do the following:

  • $375 to @gijoe0295 for this issue + taking us most of the way with the proposal on the other issue.
  • $500 to @mananjadhav for the other issue's PR, and the C+ review of this one.
  • $250 to @mollfpr for the C+ review of the other issue's PR

How does that sound?

@mananjadhav
Copy link
Collaborator

A little confused here. Are we talking about any other issue? I don’t think the blocker PR implemented was reviewed by C+. I am not in front of the system. I can check later.

@mollfpr
Copy link
Contributor

mollfpr commented Aug 15, 2024

@trjExpensify I don't think I reviewed any PR regarding this issue 😅

@trjExpensify
Copy link
Contributor

Ah, @mollfpr is right. You were assigned, but didn't review. Cool, so two issues, two PRs:

Issue: Not redirecting to workspace chat and not converting the IOU to an expense report when Pay with business account selected

Issue: Expense - "Business bank account" option appears briefly when paying with Expensify

So amending the payment summary as follows:

  • $375 to @gijoe0295 for this issue + taking us most of the way with the proposal on the other issue.
  • $500 to @mananjadhav for the other issue's PR, and the C+ review of this one.

Sound right?

@mananjadhav
Copy link
Collaborator

That’s right.

@trjExpensify
Copy link
Contributor

Okay great, go ahead and request Manan. @gijoe0295 I've settled up.

@github-project-automation github-project-automation bot moved this from Release 2.5: SuiteWorld (Sept 9th) to Done in [#whatsnext] #wave-collect Aug 15, 2024
@JmillsExpensify
Copy link

$500 approved for @mananjadhav

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
No open projects
Status: Done
Development

No branches or pull requests

9 participants