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-20] [$250] Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify #51524

Closed
1 of 8 tasks
lanitochka17 opened this issue Oct 26, 2024 · 31 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 26, 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.54-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5134693
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Default individual policy currency for both users must be USD.
  1. Go to staging.new.expensify.com
  2. [User A] Submit an expense in USD to User B
  3. [User B] Go to DM with user A
    4/ [User B] Click Pay with Expensify
  4. [User B] Click Business bank account
  5. [User B] Close the RHP
  6. [User B] Go to workspace settings of the newly created workspace
  7. [User B] Go to Members

Expected Result:

There will be no "Hidden" member

Actual Result:

"Hidden" member appears in Members list when the workspace is created via Pay with Expensify in p2p expense

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
Bug6645865_1729878847118.20241026_014655.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021853396876299534935
  • Upwork Job ID: 1853396876299534935
  • Last Price Increase: 2024-11-04
Issue OwnerCurrent Issue Owner: @zanyrenney
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 26, 2024
Copy link

melvin-bot bot commented Oct 26, 2024

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

@zanyrenney 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

@lanitochka17
Copy link
Author

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

@bernhardoj
Copy link
Contributor

Proposal

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

Hidden is shown in the workspace member after moving the expense to a new workspace.

What is the root cause of that problem?

When we select Business bank account as the payment method, we will optimistically create a new workspace based on the IOU report data.

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

The problem is, we are trying to create the workspace member from the IOU report ownerEmail.

const employeeEmail = iouReport.ownerEmail ?? '';

[sessionEmail]: {
role: CONST.POLICY.ROLE.ADMIN,
errors: {},
},
[employeeEmail]: {
role: CONST.POLICY.ROLE.USER,
errors: {},
},

However, ownerEmail doesn't exist anymore in the IOU report, only ownerAccountID, so it defaults to an empty string.

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

There was previously a plan to get the employee email from the personal detail, but I decided to just default it to an empty string because, at that time, the email wasn't really needed.

Previously, the policy member is keyed by their accountID.
image

So, the solution is to get the employee's email from the personal details data.

const employeeEmail = allPersonalDetails?.[employeeAccountID]?.login ?? '';

I don't think the personal detail login would be undefined, but we can avoid creating the employee optimistic data if employeeEmail is empty.

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@zanyrenney
Copy link
Contributor

Wave collect is closed, but adding this to expense.

Copy link

melvin-bot bot commented Nov 1, 2024

@zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@zanyrenney
Copy link
Contributor

Oops, i thought I added the external label here - my bad!

@melvin-bot melvin-bot bot removed the Overdue label Nov 4, 2024
@zanyrenney zanyrenney added External Added to denote the issue can be worked on by a contributor Overdue labels Nov 4, 2024
@melvin-bot melvin-bot bot changed the title Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify [$250] Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

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

melvin-bot bot commented Nov 4, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 4, 2024
@hungvu193
Copy link
Contributor

on my list this week

@hungvu193
Copy link
Contributor

@bernhardoj How do you reproduce this issue?

@bernhardoj
Copy link
Contributor

I just followed the OP steps and remove the currency check here so I can choose Pay with Expensfiy even without USD currency.

const canUseWallet = !isExpenseReport && !isInvoiceReport && currency === CONST.CURRENCY.USD;

@hungvu193
Copy link
Contributor

I did the same thing but it navigates to Connect Bank Account flow page instead 🤔

Screen.Recording.2024-11-07.at.13.30.37.mov

@bernhardoj
Copy link
Contributor

Hmm, that's weird. It should show a popover menu first to choose between business or personal bank account. From the code, you need to satisfy the condition to trigger triggerKYCFlow,

const selectPaymentType = (event: KYCFlowEvent, iouPaymentType: PaymentMethodType, triggerKYCFlow: TriggerKYCFlow) => {
if (policy && SubscriptionUtils.shouldRestrictUserBillableActions(policy.id)) {
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id));
return;
}
if (iouPaymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || iouPaymentType === CONST.IOU.PAYMENT_TYPE.VBBA) {
if (!isUserValidated) {
Navigation.navigate(ROUTES.SETTINGS_WALLET_VERIFY_ACCOUNT.route);
return;
}
triggerKYCFlow(event, iouPaymentType);
BankAccounts.setPersonalBankAccountContinueKYCOnSuccess(ROUTES.ENABLE_PAYMENTS);
return;
}

and this, inside triggerKYCFlow.

// Check to see if user has a valid payment method on file and display the add payment popover if they don't
if (
(isExpenseReport && reimbursementAccount?.achData?.state !== CONST.BANK_ACCOUNT.STATE.OPEN) ||
(!isExpenseReport && bankAccountList !== null && !PaymentUtils.hasExpensifyPaymentMethod(paymentCardList, bankAccountList, shouldIncludeDebitCard))
) {
Log.info('[KYC Wallet] User does not have valid payment method');
if (!shouldIncludeDebitCard) {
selectPaymentMethod(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT);
return;
}
const clickedElementLocation = getClickedTargetLocation(targetElement as HTMLDivElement);
const position = getAnchorPosition(clickedElementLocation);
setPositionAddPaymentMenu(position);
setShouldShowAddPaymentMenu(true);
return;
}

@hungvu193
Copy link
Contributor

Nevermind, I can reproduce it with my brand new account 🤦

@melvin-bot melvin-bot bot added the Weekly KSv2 label Nov 11, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @hungvu193

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 11, 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 Nov 13, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify [HOLD for payment 2024-11-20] [$250] Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify Nov 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

Copy link

melvin-bot bot commented Nov 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.60-3 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-20. 🎊

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

  • @hungvu193 requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Nov 13, 2024

@hungvu193 @zanyrenney @hungvu193 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]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Nov 14, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 19, 2024
@hungvu193
Copy link
Contributor

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: We removed ownerEmail from IOU report. However we forgot to update it while selecting Business Bank Account

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. 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: https://github.com/Expensify/App/pull/39489/files#r1849609429

  • [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: Not a critical bug, we don't need to create a discussion.

  • [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

  1. User B requests money to User A in USD
  2. User A press Pay with Expensify and choose Business Bank Account. Note down the new workspace created
  3. Go to the workspace member page of the newly created workspace
  4. Verify there is no Hidden member

Do we 👍 or 👎 ?

Copy link

melvin-bot bot commented Nov 20, 2024

Payment Summary

Upwork Job

BugZero Checklist (@zanyrenney)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1853396876299534935/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@bernhardoj
Copy link
Contributor

Requested in ND.

@garrettmknight
Copy link
Contributor

@zanyrenney can you confirm the payment summary when you get a chance?

@zanyrenney
Copy link
Contributor

sure thing @garrettmknight - sorry about the delay everyone. I was out yesterday.

@zanyrenney
Copy link
Contributor

Regression test looks good - getting that added now.

@zanyrenney
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label Nov 21, 2024
@zanyrenney
Copy link
Contributor

Closed job on upwork.

Payment Summary

Reviewer: @hungvu193 owed $250 via NewDot - please request via ND
Reviewer: @bernhardoj owed $250 via NewDot - please request via ND

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Nov 21, 2024
@melvin-bot melvin-bot bot removed Overdue labels Nov 21, 2024
@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@garrettmknight
Copy link
Contributor

$250 approved for @hungvu193

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

No branches or pull requests

7 participants