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.11k stars 2.61k forks source link

[$250] Login – No Abracadabra page when logging in via Magic link #44600

Open izarutskaya opened 6 days ago

izarutskaya commented 6 days 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.3-1 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4678326 Email or phone of affected tester (no customers): applausetester+jp_228624@applause.expensifail.com Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in with new Expensifail account
  3. Copy the Magic link and change it to staging
  4. Open a new tab and navigate to the staging magic link

Expected Result:

Abracadabra page is displayed

Actual Result:

Inbox page opens. Abracadabra page isn’t displayed

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/d2d389b6-c3f2-4f0d-8e5a-23fdbf93c84b

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e239faee992134cd
  • Upwork Job ID: 1806768165074984740
  • Last Price Increase: 2024-06-28
Issue OwnerCurrent Issue Owner: @aimane-chnaif
melvin-bot[bot] commented 6 days ago

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

melvin-bot[bot] commented 6 days ago

Triggered auto assignment to @dangrous (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

github-actions[bot] commented 6 days ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
izarutskaya commented 6 days ago

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

dangrous commented 6 days ago

This is definitely external. Haven't figured out the cause yet, I need to remember how to send magic links from dev.

dangrous commented 6 days ago

So I just tried this with the production build and the production server on my local and still had it occur.

I think this might be something just with copying and modifying the link, rather than literally clicking on it... I vaguely remember something about that in another bug in the past. But I'm not confident yet - other ideas welcome!

dangrous commented 6 days ago

Trying to get some assistance here - https://expensify.slack.com/archives/C01GTK53T8Q/p1719583721705269

garrettmknight commented 6 days ago

The abracadabra page is just a confirmation so I don't think we need to call this a blocker.

melvin-bot[bot] commented 6 days ago

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

melvin-bot[bot] commented 6 days ago

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

jainilparikh commented 4 days ago

Proposal

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

abracadabra page is not shown to the user when they open the link on another tab.

What is the root cause of that problem?

This is the section of code that controls the abracadabra page: https://github.com/Expensify/App/blob/main/src/pages/ValidateLoginPage/index.website.tsx#L75

Thesession returned by the Backend is stuck in 'signing-in' state. It should be just-signed-in state for the abracadabra page to appear.

autoAuthState
: 
"signing-in"
loading
: 
false

TLDR: The session (ONYXKEYS.SESSION) state in Onyx is not updated even when the user's sign-in is completed. Once the user's sign-in is completed, the session should be: {loading: false, autoAuthState: 'just-signed-in', ...}

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

A. We should refresh the value stored in session in Onyx periodically to get the latest state from backend.

OR

Was there a recent change in Backend APIs related to this ?

What alternative solutions did you explore? (Optional)

aimane-chnaif commented 3 days ago

@jainilparikh can you please link the offending PR?

jainilparikh commented 3 days ago

@aimane I think this is a backend issue

aimane-chnaif commented 3 days ago

I think this is a backend issue

If so, it should not be reproducible on main, pointing to production backend unless there was backend deploy since last Friday. Did you confirm?

dangrous commented 2 days ago

It doesn't look like we deployed any backend changes between when this bug was reported and when I tested it with prod/prod server and staging/staging server, so I don't think it's backend? But I would be happy to be proven wrong. I'm still confused how it could show the behavior I noted in Slack - copied below for reference - so there might be something funky going on.

This happens on staging, but not on prod.

Testing locally, it happens on the staging build using the staging server - but also on the production build using the production server.

So…. I’m a little confused as to what might be happening here. Is it front end? back end? neither? Or am I testing incorrectly (checking out staging or production, using env.production or env.staging)?

aimane-chnaif commented 17 hours ago

Still looking for proposals with the correct root cause (aka. offending PR)