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 2023-05-02] [$1000] Secondary login - Red dot stays after adding email with Expensify account #17343

Closed
3 of 6 tasks
kbecciv opened this issue Apr 12, 2023 · 35 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Apr 12, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #15330

Action Performed:

  1. Go https://staging.new.expensify.com/
    and login
  2. Go to profile
  3. Add as secondary login an email that has expensify account (or that was added to another account as secondary login)
  4. Error message is displayed with red dot
  5. Click X to dismiss the error

Expected Result:

Red dot should disappear across the app

Actual Result:

Red Dot stays for some time

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • Windows / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.99.3

Reproducible in staging?: Yes

Reproducible in production?: New feature

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6014995_video_82.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Natnael-Guchima & Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013e2ea9daf6a5597b
  • Upwork Job ID: 1648326062248083456
  • Last Price Increase: 2023-04-18
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 12, 2023
@MelvinBot
Copy link

Triggered auto assignment to @miljakljajic (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

MelvinBot commented Apr 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Overdue label Apr 14, 2023
@miljakljajic
Copy link
Contributor

Reproducible for me:

image

@melvin-bot melvin-bot bot removed the Overdue label Apr 14, 2023
@miljakljajic
Copy link
Contributor

Going to spin the wheel on this again as I am OOO next week.

@miljakljajic miljakljajic removed their assignment Apr 14, 2023
@miljakljajic miljakljajic added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Apr 14, 2023
@MelvinBot
Copy link

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Overdue label Apr 17, 2023
@MelvinBot
Copy link

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

@slafortune
Copy link
Contributor

Looks like @miljakljajic has verified this as well, it just needed the external label applied

@melvin-bot melvin-bot bot removed the Overdue label Apr 18, 2023
@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label Apr 18, 2023
@melvin-bot melvin-bot bot changed the title Secondary login - Red dot stays after adding email with Expensify account [$1000] Secondary login - Red dot stays after adding email with Expensify account Apr 18, 2023
@MelvinBot
Copy link

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

@Expensify Expensify deleted a comment from MelvinBot Apr 18, 2023
@MelvinBot
Copy link

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 18, 2023
@MelvinBot
Copy link

Triggered auto assignment to @alex-mechler (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@bernhardoj
Copy link
Contributor

Proposal

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

Add contact method error is not gone even after we remove the contact method.

What is the root cause of that problem?

We are not clearing the error data. Actually, we already have the logic to remove the error as can be shown below

function deleteContactMethod(contactMethod, oldLoginData) {
// If the contact method failed to be added to the account, then it should only be deleted locally.
if (lodashGet(oldLoginData, 'errorFields.addedLogin', null)) {
Onyx.merge(ONYXKEYS.LOGIN_LIST, {[contactMethod]: null});
return;
}

However, the if block never executes because we didn't pass the oldLoginData.

if (!_.isEmpty(lodashGet(this.props.loginList, [this.getContactMethod(), 'errorFields'], {}))) {
User.deleteContactMethod(this.getContactMethod());
return;
}

User.deleteContactMethod(this.getContactMethod());

Even the successData won't be applied here because the request is failed. Why? Because the contact method does not exist on the server because it fails to add, that's why we have the if block above.

const successData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: null,
},
}];

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

Simply pass the loginData to the delete function and navigate back as we do here

Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS);

User.deleteContactMethod(contactMethod, this.props.loginList[contactMethod])

I'm thinking to connect a new onyx key (which is LOGIN_LIST) inside the User.js file, so we don't need to pass the loginData anymore.

@MelvinBot
Copy link

📣 @bernhardoj You have been assigned to this job by @alex-mechler!
Please apply to this job in Upwork 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 📖

@alex-mechler
Copy link
Contributor

Thanks! Assigned @bernhardoj. This looks like a simple oversight like you mentioned

@bernhardoj
Copy link
Contributor

PR is ready.

@NicMendonca
Copy link
Contributor

@slafortune is on the BZ team, so going to unassign myself 👍

@NicMendonca NicMendonca removed their assignment Apr 19, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Secondary login - Red dot stays after adding email with Expensify account [HOLD for payment 2023-05-02] [$1000] Secondary login - Red dot stays after adding email with Expensify account Apr 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 25, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.4-0 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 2023-05-02. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

MelvinBot commented Apr 25, 2023

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:

@parasharrajat parasharrajat mentioned this issue Apr 25, 2023
54 tasks
@parasharrajat
Copy link
Member

parasharrajat commented Apr 25, 2023

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:

[@parasharrajat] The PR that introduced the bug has been identified. Link to the PR: #15330
[@parasharrajat] 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/15330/files#r1176010564
[@parasharrajat] 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: https://expensify.slack.com/archives/C049HHMV9SM/p1682399421775809

[@parasharrajat] 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. #17343 (comment)

@parasharrajat
Copy link
Member

parasharrajat commented Apr 25, 2023

Regression Test Steps

  1. On an account with no indicator on the avatar, open the Contacts page from Settings > Profile > Click on the selected Contact method.
  2. Click Add New Contact Method button.
  3. Add an email that is already an Expensify account.
  4. Click save.
  5. Observe that an error is thrown and the Red Dot indicator is shown on the Avatar(Settings button).
  6. Go back to the contacts list.
  7. Open the errored contact.
  8. Click remove to delete the errored contact.
  9. Verify that the Red dot indicator is gone on the avatar.

Do you agree 👍 or 👎 ?

@alex-mechler
Copy link
Contributor

Those regression steps look mostly good. I would change the set up to require an account with no indicator on the avatar so that for step 9 we can say Verify that the Red dot indicator is gone on the avatar, instead of having the tester have to remember what the original state of the avatar was.

Maybe:

  1. On an account with no indicator on the avatar, open the Contacts page from Settings > Profile > Click on the selected Contact method.
  2. Click Add New Contact Method button.
  3. Add an email that is already an Expensify account.
  4. Click save.
  5. Observe that an error is thrown and the Red Dot indicator is shown on the Avatar(Settings button).
  6. Go back to the contacts list.
  7. Open the errored contact.
  8. Click remove to delete the errored contact.
  9. Verify that the Red dot indicator is gone on the avatar

@parasharrajat
Copy link
Member

Agree updated

@melvin-bot melvin-bot bot added the Overdue label May 3, 2023
@alex-mechler
Copy link
Contributor

@slafortune This is ready to be paid out / your steps completed on the BZ checklist

@slafortune
Copy link
Contributor

Hired @Natnael-Guchima, @parasharrajat , and @bernhardoj

@Natnael-Guchima
Copy link

Hired @Natnael-Guchima, @parasharrajat , and @bernhardoj

Accepted the offer. Thanks!!

@parasharrajat
Copy link
Member

I think we are missing the bonus on this.

@slafortune
Copy link
Contributor

Ah! Sorry about that - you're correct. I used the 25th rather than the 21st when checking!

@slafortune
Copy link
Contributor

@parasharrajat I've paid the bonus out to you
@bernhardoj I've added the bonus to your job for this.

👍

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants