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

Expense-"Hidden" appears in Members list when the workspace is created via Pay with Expensify #51524

Open
1 of 8 tasks
lanitochka17 opened this issue Oct 26, 2024 · 4 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 26, 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.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): applausetester+kh1610015@applause.expensifail.com
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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

3 participants