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] Login - Endless loading when login existing account #45225

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 10, 2024 · 22 comments
Closed
1 of 6 tasks

[$250] Login - Endless loading when login existing account #45225

lanitochka17 opened this issue Jul 10, 2024 · 22 comments
Assignees
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 10, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.6-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Login with existing account

Expected Result:

Last visited chat should be displayed

Actual Result:

There is a endless loading when login existing gmail or expensifail e-mail account

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6538448_1720652616055.Recording__3466.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a1b081cc7a723886
  • Upwork Job ID: 1811211337050638831
  • Last Price Increase: 2024-07-18
Issue OwnerCurrent Issue Owner: @thesahindia
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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

Copy link
Contributor

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

@lanitochka17
Copy link
Author

@marcaaron FYI 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

@marcaaron
Copy link
Contributor

I can repro this so it's a blocker for sure. No idea what's causing it.

@marcaaron marcaaron added the External Added to denote the issue can be worked on by a contributor label Jul 11, 2024
Copy link

melvin-bot bot commented Jul 11, 2024

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

@melvin-bot melvin-bot bot changed the title Login - Endless loading when login existing account [$250] Login - Endless loading when login existing account Jul 11, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 11, 2024
Copy link

melvin-bot bot commented Jul 11, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Jul 11, 2024

Proposal

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

There is a endless loading when login existing gmail or expensifail e-mail account

We can reproduce this bug by refreshing the App 1-2 times.

What is the root cause of that problem?

After logging in we call OpenApp API

API.write(WRITE_COMMANDS.OPEN_APP, params, getOnyxDataForOpenOrReconnect(true));

That make isLoading: true optimistically. It only becomes false after API call is end

In PersistedRequests

we're updating persistedRequests in 2 places:

  1. From onyx update here
  2. From save

It causes the race condition.

Let's assume we have 3 APIs.

  • save API 1 -> persistedRequests = [API1]
  • save API 2 -> persistedRequests = [API1, API2]
  • onyx update API 1 -> persistedRequests = [API1]
  • save API 3 -> persistedRequests = [API1, API3]
  • onyx update API 2 -> persistedRequests = [API1, API2]
  • onyx update API 3 -> persistedRequests = [API1, API3]

expected persistedRequests is [API1, API2, API3]

-> In this case, OpenApp is never called -> isLoadingApp is false forever

Video evidence:
web-resize.mp4

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

We should update persistedRequests from onyx at the first time only.

let init = true;
Onyx.connect({
    key: ONYXKEYS.PERSISTED_REQUESTS,
    callback: (val) => {
        if(!init){
            return;
        }
        init = false
        persistedRequests = val ?? []
    },
});

What alternative solutions did you explore? (Optional)

Result

web-resize.mp4

@danieldoglas
Copy link
Contributor

I don't think this is related to backend, removing the DeployBlocker tag

@danieldoglas danieldoglas removed the DeployBlocker Indicates it should block deploying the API label Jul 11, 2024
@kavimuru
Copy link

@Julesssss this issue is fixed.

Recording.3494.mp4

@Julesssss Julesssss added Daily KSv2 and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment labels Jul 12, 2024
@dominictb
Copy link
Contributor

web-resize.mp4

@kavimuru @Julesssss I still can reproduce. You can try to reload the app.

@melvin-bot melvin-bot bot added the Overdue label Jul 15, 2024
@Julesssss
Copy link
Contributor

I still can reproduce. You can try to reload the app.

I'm unable to repro on staging, so perhaps this will reoccur once we deploy again. Let's leave it as not a blocker in the meantime.

Copy link

melvin-bot bot commented Jul 15, 2024

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

Copy link

melvin-bot bot commented Jul 17, 2024

@marcaaron, @thesahindia Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Jul 18, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Jul 19, 2024

@marcaaron, @thesahindia Still overdue 6 days?! Let's take care of this!

@thesahindia
Copy link
Member

I was unable to repro this on staging and at the latest main. I tried just now.

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2024
@marcaaron marcaaron added the Needs Reproduction Reproducible steps needed label Jul 19, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

Copy link

melvin-bot bot commented Jul 23, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jul 23, 2024
@marcaaron
Copy link
Contributor

I'm gonna close this and we can reopen if it's still reproducible. If we do reopen please provide more information about how to reproduce if possible.

@melvin-bot melvin-bot bot removed the Overdue label Jul 23, 2024
@dominictb
Copy link
Contributor

@marcaaron I can reproduce it.

  1. Logout if login before
  2. Go to https://dev.new.expensify.com:8082/r/2091104345528462
  3. Reload app
  4. Observe the page shows loading view forever
test.mp4

@marcaaron
Copy link
Contributor

marcaaron commented Jul 24, 2024

Issues are reported for the live staging branch. Can you reproduce it on staging.new.expensify.com? Can you share any other information to help us identify a root cause?

@dominictb
Copy link
Contributor

@marcaaron Unfortunately, I can't reproduce on staging, but I still can reproduce on main (Because of race condition). The RCA is because we're updating persistedRequests in 2 places here and here. That causes the race condition. For more information, you can check my proposal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

8 participants