App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Secondary login sends two magic codes for validation - causes login/rejection loop

Open mallenexpensify opened this issue 1 year ago • 13 comments

OG issue in E/E

  • https://github.com/Expensify/Expensify/issues/445252

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 avatar Nov 26 '24 01:11 mallenexpensify

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

melvin-bot[bot] avatar Nov 26 '24 01:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 26 '24 01:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 26 '24 01:11 melvin-bot[bot]

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();. https://github.com/Expensify/App/blob/3f4e93ee40462b42f5fe331fdf9db5c9bbb1a421/src/components/ValidateCodeActionModal/index.tsx#L45-L52

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

Krishna2323 avatar Nov 26 '24 02:11 Krishna2323

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

brunovjk avatar Nov 26 '24 14:11 brunovjk

This is on OldDot / Expensify Classic.

RachCHopkins avatar Nov 26 '24 21:11 RachCHopkins

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

myspace20 avatar Nov 28 '24 10:11 myspace20

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

brunovjk avatar Nov 28 '24 14:11 brunovjk

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

melvin-bot[bot] avatar Dec 02 '24 09:12 melvin-bot[bot]

Not overdue, waiting for response on the comment.

cc: @mallenexpensify

brunovjk avatar Dec 02 '24 12:12 brunovjk

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

mallenexpensify avatar Dec 02 '24 20:12 mallenexpensify

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

https://github.com/user-attachments/assets/069e6e93-8abc-4abb-88c0-d51baf05947d

ugogiordano avatar Dec 02 '24 23:12 ugogiordano

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 :)

brunovjk avatar Dec 06 '24 11:12 brunovjk

Waiting for internal engineering assignment.

isabelastisser avatar Dec 09 '24 15:12 isabelastisser

@isabelastisser this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Dec 10 '24 09:12 melvin-bot[bot]

Waiting for internal engineering assignment.

isabelastisser avatar Dec 13 '24 03:12 isabelastisser

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

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 18 '24 09:12 melvin-bot[bot]

Waiting for internal engineering assignment.

isabelastisser avatar Dec 18 '24 19:12 isabelastisser

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

isabelastisser avatar Dec 20 '24 21:12 isabelastisser

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Dec 21 '24 02:12 mvtglobally

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

melvin-bot[bot] avatar Dec 24 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 26 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 30 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 01 '25 09:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 03 '25 09:01 melvin-bot[bot]

I'll take a look

MonilBhavsar avatar Jan 03 '25 14:01 MonilBhavsar

Sent PR for review

MonilBhavsar avatar Jan 03 '25 21:01 MonilBhavsar

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

MonilBhavsar avatar Jan 03 '25 22:01 MonilBhavsar

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

MonilBhavsar avatar Jan 03 '25 22:01 MonilBhavsar