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] Secondary login sends two magic codes for validation - causes login/rejection loop #53105

Closed
mallenexpensify opened this issue Nov 26, 2024 · 34 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review

Comments

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Nov 26, 2024

OG issue in E/E

Action Performed:

Log into account
Add secondary login
Enter Magic code for existing account to allow secondary email to be added
Send magic code to verify secondary email

Expected Result:

Secondary email is sent a single magic code for verification

Actual Result:

Secondary email is sent a magic code for verification and then immediately sent an additional magic code seconds later.

In practice, this means that by the time the user has entered the first magic code, it has been invalidated with a new magic code. If they don't realise this and they click to verify again, that code invalidates the previous code, and this can keep going.

image

image

Workaround:

The user must wait until they get the second email, and then use only that code. But no one realises this. It explains why so many customers report that their code doesn't work when adding secondary login.

Platform:

Expensify Classic - not New Expensify

Internal only, do not post to External repos

N/A this came via setting up a customer training session with demo data.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861224421434105287
  • Upwork Job ID: 1861224421434105287
  • Last Price Increase: 2024-11-26
Issue OwnerCurrent Issue Owner: @brunovjk
@mallenexpensify mallenexpensify added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 26, 2024
@melvin-bot melvin-bot bot changed the title Secondary login sends two magic codes for validation - causes login/rejection loop [$250] Secondary login sends two magic codes for validation - causes login/rejection loop Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

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

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

melvin-bot bot commented Nov 26, 2024

Current assignee @isabelastisser is eligible for the Bug assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Nov 26, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 26, 2024

Edited by proposal-police: This proposal was edited at 2024-11-26 02:33:05 UTC.

Proposal


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

Secondary login sends two magic codes for validation - causes login/rejection loop

What is the root cause of that problem?

  • In addNewContactMethod we are not setting the parameter validateCodeSent: true,. Due to this hasMagicCodeBeenSent becomes false and we again call sendValidateCode();.
    useEffect(() => {
    if (!firstRenderRef.current || !isVisible || hasMagicCodeBeenSent) {
    return;
    }
    firstRenderRef.current = false;
    sendValidateCode();
    }, [isVisible, sendValidateCode, hasMagicCodeBeenSent]);

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


  • We should update the validateCodeSent value inside addNewContactMethod and also update the pending field if required. We should also update in failure data validateCodeSent: null.
  • I think this also needs backend change because the new email already receives 2 validation code when AddNewContactMethod is called.

What alternative solutions did you explore? (Optional)

Result

@brunovjk
Copy link
Contributor

I didn’t find Add secondary login on NewDot. I can reproduce the issue using OldDot on prod, but I’m unsure if I can set up OldDot or hybrid in a dev now. @mallenexpensify, could you confirm if the issue is specifically for OldDot or impacts NewDot as well? Could you provide more details on the expectations here? Thank you :D

@RachCHopkins
Copy link
Contributor

This is on OldDot / Expensify Classic.

@myspace20
Copy link

@brunovjk is there a way to set up the OldDot in a dev environment? I went through the docs but couldn't find anything on that.

@brunovjk
Copy link
Contributor

I asked on Slack for help https://expensify.slack.com/archives/C01GTK53T8Q/p1732758681575069

Copy link

melvin-bot bot commented Dec 2, 2024

@isabelastisser, @brunovjk Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@brunovjk
Copy link
Contributor

brunovjk commented Dec 2, 2024

Not overdue, waiting for response on the comment.

cc: @mallenexpensify

@mallenexpensify
Copy link
Contributor Author

@brunovjk from the OG issue in E/E repo

Expensify Classic - not New Expensify

So.. I'm guessing this has to be Internal and, once a PR is raised, you'd review that PR (assuming it's accessible to you in the repo). Sound right?

@isabelastisser isabelastisser added Internal Requires API changes or must be handled by Expensify staff Hot Pick Ready for an engineer to pick up and run with and removed External Added to denote the issue can be worked on by a contributor labels Dec 2, 2024
@ugogiordano
Copy link
Contributor

@mallenexpensify, @brunovjk this issue is reproducible in dev environment:

Screen.Recording.2024-11-30.at.00.54.19.00.17.49.mp4

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2024
@brunovjk
Copy link
Contributor

brunovjk commented Dec 6, 2024

This is an internal issue, so I'll unassign myself, but if this requires any review or front-end testing, please reassign me. I'd love to help, thanks :)

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2024
@brunovjk brunovjk removed their assignment Dec 6, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@isabelastisser
Copy link
Contributor

Waiting for internal engineering assignment.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 13, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

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

Copy link

melvin-bot bot commented Dec 18, 2024

@isabelastisser Eep! 4 days overdue now. Issues have feelings too...

@isabelastisser
Copy link
Contributor

Waiting for internal engineering assignment.

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2024
@isabelastisser
Copy link
Contributor

FYI, I will be OOO from Dec 23 to Jan 6, so please reassign the issue to another team member for urgency, IF needed.

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

Copy link

melvin-bot bot commented Dec 26, 2024

@isabelastisser Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Dec 30, 2024

@isabelastisser 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Jan 1, 2025

@isabelastisser 10 days overdue. Is anyone even seeing these? Hello?

Copy link

melvin-bot bot commented Jan 3, 2025

@isabelastisser 12 days overdue. Walking. Toward. The. Light...

@MonilBhavsar MonilBhavsar self-assigned this Jan 3, 2025
@melvin-bot melvin-bot bot removed the Overdue label Jan 3, 2025
@MonilBhavsar
Copy link
Contributor

I'll take a look

@MonilBhavsar MonilBhavsar removed Hot Pick Ready for an engineer to pick up and run with Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 3, 2025
@MonilBhavsar
Copy link
Contributor

Sent PR for review

@MonilBhavsar MonilBhavsar added the Reviewing Has a PR in review label Jan 3, 2025
@MonilBhavsar
Copy link
Contributor

Noticed we are also sending consecutive notifications in App. Fixed it too

@MonilBhavsar
Copy link
Contributor

Not much, but I think we'll save little on our email bills 😅

Copy link

melvin-bot bot commented Jan 13, 2025

@isabelastisser, @MonilBhavsar Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Jan 15, 2025

@isabelastisser, @MonilBhavsar Still overdue 6 days?! Let's take care of this!

@isabelastisser
Copy link
Contributor

Hey @MonilBhavsar, can you please provide an update? Would you like to reassign this?

@MonilBhavsar
Copy link
Contributor

Oops, this was fixed two weeks back. Closing it

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 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review
Projects
Development

No branches or pull requests

9 participants