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.58k stars 2.92k forks source link

[HOLD for payment 2023-10-25] [HOLD for payment 2023-10-24] Login - User is not automatically logged in with magic link in different tab #29807

Closed lanitochka17 closed 1 year ago

lanitochka17 commented 1 year 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: 1.3.85-0

Reproducible in staging?: Yes

Reproducible in production?: No

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

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com./
  2. Enter any email you have access to
  3. Go to email inbox and look for the magic link
  4. Go to different tab, change the link to staging and go to it
  5. Abracadabra page should be displayed
  6. Go to original tab

Expected Result:

User should be automatically logged in and able to use the app on the original tab

Actual Result:

User must refresh the page to appear logged in and use the app

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/78819774/86808da8-fdc6-4d1b-b69e-36a6e9c064b1
MacOS: Desktop

View all open jobs on GitHub

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

OSBotify commented 1 year 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.
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @thienlnam (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

francoisl commented 1 year ago

~This pull request just made it to staging and modified some sign-in logic. Not sure yet if it's the culprit but sounds like a possibility. cc @NikkiWines @MonilBhavsar if you're around and have an idea.~

francoisl commented 1 year ago

I reverted 28372 on dev and can still reproduce the issue, so I don't think it's that.

thienlnam commented 1 year ago

:hmm: If it's not that, it probably is related to some subscriber on the login page that is no longer prompting a refresh. I am looking at changes on that page but not seeing anything obvious

alitoshmatov commented 1 year ago

This issue is originating from this line: https://github.com/Expensify/App/blob/0a3ce767f12802d184c434efe2790dea5188af1a/src/libs/Navigation/AppNavigator/AuthScreens.js#L370-L372 If we remove retrieving demoInfo the issue won't happen. But I couldn't find why this is happening, I thought it was because we are accessing onyx data which is not present, but changing key here to any random string did not produce this issue. So the issue is only happening for demoInfo

Hope it helps

francoisl commented 1 year ago

Yeah thanks. Just finished a git bisect and found that the issue comes from this PR, specifically this commit, which matches what you found.

cc @Beamanator

francoisl commented 1 year ago

@s77rt do you have any idea off the top of your head? This appears to be coming from https://github.com/Expensify/App/pull/29288.

s77rt commented 1 year ago

Hmm, we used same patterns for similar temporary flows. Could it be related to this https://github.com/Expensify/App/pull/29288/files#r1358416934? Can you try use Navigation.isNavigationReady promise and see if that fixes it?

cc @alitoshmatov if you are available to test

alitoshmatov commented 1 year ago

Doing this didn't work

Screenshot 2023-10-18 at 01 31 28

cc: @s77rt

francoisl commented 1 year ago

I feel like it's some sort of race condition with updating a key in Onyx? Commenting this line out solves the issue.

alitoshmatov commented 1 year ago

Removing that line looks reasonable and is not effecting expected behavior, and it tests well.

francoisl commented 1 year ago

Alternatively changing it to Onyx.set(ONYXKEYS.DEMO_INFO, {}); seems to work, but I can't 100% confirm at the moment as my dev environment is in a weird half-broken state. Might be better than removing the line entirely, if we can confirm it works.

alitoshmatov commented 1 year ago

It is working. https://github.com/Expensify/App/assets/59907218/069cc554-c963-4b43-9ba5-5985735f863c

francoisl commented 1 year ago

Nice. @thienlnam let's roll with that?

francoisl commented 1 year ago

I fixed my dev environment, sending a PR shortly.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

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.

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

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

Beamanator commented 1 year ago

Oof thanks for fixing, y'all 🙈

melvin-bot[bot] commented 1 year ago

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

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.

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

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

zanyrenney commented 1 year ago

Should be all good here as the payment is being handled here, all other assignees here are internal - https://github.com/Expensify/App/issues/29577 !