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.52k stars 2.87k forks source link

[HOLD for payment 2024-10-10] [$250] Copilot - Missing email in RHP header and message when adding new contact #48968

Closed IuliiaHerets closed 3 weeks ago

IuliiaHerets commented 1 month 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: 9.0.32-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Login as copilot
  3. Go to Account settings.
  4. Click on the account switcher.
  5. Switch to another account.
  6. Click Contact method.
  7. Click New contact method.
  8. Enter a new contact method > Next.

Expected Result:

The RHP header will show the current contact method.

Actual Result:

The RHP header is missing when confirming magic code for adding new contact method. Also, the message "Please enter the magic code sent to" is also missing the email.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/13793b42-b666-462f-abfd-61f37ff10dba

https://github.com/user-attachments/assets/91527319-07f0-4b56-8c85-84591231b31a

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834067418784580129
  • Upwork Job ID: 1834067418784580129
  • Last Price Increase: 2024-09-12
  • Automatic offers:
    • nkdengineer | Contributor | 103936362
Issue OwnerCurrent Issue Owner: @RachCHopkins
melvin-bot[bot] commented 1 month ago

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

IuliiaHerets commented 1 month ago

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

RachCHopkins commented 1 month ago

Go to staging.new.expensify.com Login as copilot

I don't appear to be able to do this at all. I have tried multiple accounts with copilots and I don't have the drop-down.

RachCHopkins commented 1 month ago

@kadie is gonna repro for me.

kadiealexander commented 1 month ago

Reproduced in web chrome:

https://github.com/user-attachments/assets/e1959f18-09f3-4b99-abaf-571699fb3b67

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

nkdengineer commented 1 month ago

Edited by proposal-police: This proposal was edited at 2024-09-12 03:46:19 UTC.

Proposal

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

The RHP header is missing when confirming magic code for adding new contact method. Also, the message "Please enter the magic code sent to" is also missing the email.

What is the root cause of that problem?

We get the contact method by accessing account?.primaryLogin. In the case of accessing account via Copilot, the account data doesn't have primaryLogin field

Screenshot 2024-09-12 at 10 37 35

https://github.com/Expensify/App/blob/336e4782aec98bb29a06c28e0d630c276d4eddf6/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx#L41

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

We should use session data to get the email of the user

const [session] = useOnyx(ONYXKEYS.SESSION);
const contactMethod = session?.email ?? '';

https://github.com/Expensify/App/blob/336e4782aec98bb29a06c28e0d630c276d4eddf6/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx#L41

const contactMethod = Object.keys(loginList ?? {}).find((login) => loginList?.[login]?.partnerUserID === login);

or if we want to default contact method we can find in the login list that the email is partnerUserID

or we can prevent user add new contact method if we can't access account?.primaryLogin

We also need to fix the other cases in that we use account?.primaryLogin

What alternative solutions did you explore? (Optional)

NA

sobitneupane commented 1 month ago

Thanks for the proposal @nkdengineer

I believe we should use session?.email only if account?.primaryLogin is not available. What do you think?

const contactMethod = account?.primaryLogin ?? session?.email ?? '';

We also need to fix the other cases in that we use account?.primaryLogin

Could you please specify which other features or cases require changes involving the use of account?.primaryLogin?

nkdengineer commented 1 month ago

I believe we should use session?.email only if account?.primaryLogin is not available. What do you think?

@sobitneupane I think that makes sense. I think we can create a util for this and use in other places.

Could you please specify which other features or cases require changes involving the use of account?.primaryLogin?

I checked the use of account?.primaryLogin in the App and see that we have some other places that we use this data.

sobitneupane commented 1 month ago

Thanks for the update @nkdengineer

Proposal from @nkdengineer looks good to me.

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 1 month ago

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

rafecolton commented 1 month ago

Proposal LGTM, assigning @nkdengineer

melvin-bot[bot] commented 1 month 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 📖

rafecolton commented 1 month ago

Approved the PR, waiting for a response here before merging.

rafecolton commented 1 month ago

PR is merged

RachCHopkins commented 1 month ago

@sobitneupane the automation has failed here, can I get you to do the checklist, please?

And I guess this will be ready to pay on 8 October.

sobitneupane commented 1 month ago

Regression Test Proposal

  1. Login as copilot
  2. Go to Account settings.
  3. Click on the account switcher.
  4. Switch to another account.
  5. Click Contact method.
  6. Click New contact method.
  7. Enter a new contact method > Next.
  8. Verify that correct contact method is displayed on the RHP header.

Do we agree 👍 or 👎

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.43-6 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-10-10. :confetti_ball:

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

melvin-bot[bot] commented 1 month 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:

RachCHopkins commented 3 weeks ago

Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

sobitneupane commented 3 weeks ago

@RachCHopkins I will need payment summary to request payment in newdot.

RachCHopkins commented 3 weeks ago

Sorry @sobitneupane I didn't realise Melvin's summary was leaving that out!

Payment Summary:

Upwork job here

garrettmknight commented 1 week ago

$250 approved for @sobitneupane