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

[$250] Wallet - Missing email in "Please enter the magic code sent to" when revealing card details as copilot #57618

Open
8 tasks done
lanitochka17 opened this issue Feb 28, 2025 · 6 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 28, 2025

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.1.7-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: N/A
Email or phone of affected tester (no customers): applausetester+sj9032@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User A has assigned a virtual card to themselves
  • User B (copilot) has limited access to User A account
  • The following steps are done by User B
  1. Go to staging.new.expensify.com
  2. Go to Account settings
  3. Open account switcher
  4. Select User A (with limited access)
  5. Go to Wallet
  6. Click on the virtual card
  7. Click Reveal details

Expected Result:

"Please enter the magic code sent to" message will show the email

Actual Result:

"Please enter the magic code sent to" message is missing the email

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
Bug6757593_1740754288053.20250228_224146.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021895518523085098853
  • Upwork Job ID: 1895518523085098853
  • Last Price Increase: 2025-02-28
Issue OwnerCurrent Issue Owner: @fedirjh
@lanitochka17 lanitochka17 added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 28, 2025
Copy link

melvin-bot bot commented Feb 28, 2025

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.

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Feb 28, 2025
@melvin-bot melvin-bot bot changed the title Wallet - Missing email in "Please enter the magic code sent to" when revealing card details as copilot [$250] Wallet - Missing email in "Please enter the magic code sent to" when revealing card details as copilot Feb 28, 2025
Copy link

melvin-bot bot commented Feb 28, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 28, 2025
Copy link

melvin-bot bot commented Feb 28, 2025

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented Feb 28, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-28 18:01:20 UTC.

Proposal

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

Missing email in "Please enter the magic code sent to" when revealing card details as copilot

What is the root cause of that problem?

When acting as a delegate, the account data is missing the primaryLogin:

descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})}

Image

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

Use the util here to fallback to session.email:

App/src/libs/UserUtils.ts

Lines 260 to 262 in 9672b4a

function getContactMethod(): string {
return account?.primaryLogin ?? session?.email ?? '';
}

We can optionally apply this same fix to other pages using account.primaryLogin for the enterMagicCode copies.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None - UI bug

What alternative solutions did you explore? (Optional)

None

Copy link
Contributor

⚠️ @gijoe0295 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@twilight2294
Copy link
Contributor

Proposal

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

Missing email in "Please enter the magic code sent to" when revealing card details as copilot

What is the root cause of that problem?

The primaryLogin is fetched from the current accounts primary login value, when someone co-pilots in the account we do not have this field set as now we are acting as a delegate, this causes the bug in the OP, this is the RCA:

const primaryLogin = account?.primaryLogin ?? '';

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

We should use the hook currentUserPersonalDetails to find the details of the user and then assign it to primary login:

    const primaryLogin = formatPhoneNumber(currentUserPersonalDetails?.login ?? '');
  • We need to format the input incase the login is a phone number

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We write up a UI test for this bug, we should update the onyx data to show that the current user has been logged in as a copilot, then render the virtual expensify card page, we will set isValidateCodeActionModalVisible to true and then check the UI to expect that the email/phone number of the original account owner is visible rather than a empty string.

What alternative solutions did you explore? (Optional)

we can use the util getContactMethod() to get the login

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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: LOW
Development

No branches or pull requests

5 participants