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.34k stars 2.77k forks source link

[$500] mWeb - When user sign out, apple&google icon displayed with delay #33414

Closed lanitochka17 closed 8 months ago

lanitochka17 commented 9 months 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.4.15-1 Reproducible in staging?: Y Reproducible in production?: Y 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. Note apple&google icon displayed without delay
  3. Login
  4. Tap profile icon
  5. Tap sign out
  6. Note apple&google icon

Expected Result:

When user opens staging.expensify.com or sign out and navigate to staging.expensify.com, apple&google icon must be displayed without delay

Actual Result:

When user sign out, apple&google icon displayed after a second in delay But when user opens staging.expensify.com, apple&google icon displayed without delay

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/ee62ef91-52cd-4ac1-846c-f8108cd89ddf

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c83a1df166670dd9
  • Upwork Job ID: 1737840324625842176
  • Last Price Increase: 2024-01-04
melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 9 months ago

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

suneox commented 9 months ago

Proposal

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

Login - When user sign out, apple&google icon displayed with delay

What is the root cause of that problem?

At BaseLoginForm script loading for AppleSignIn and GoogleSignIn only load when component render, so when network is slow it will take time to load the script

Screenshot 2023-12-22 at 00 27 43

and the button only display when script loaded

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

Instead of return null until script loaded, we will return a ActivityIndicator or fake icon button both Apple and Google POC

https://github.com/Expensify/App/assets/11959869/27c21200-87ff-4ac5-bdd5-c60e3749f909

What alternative solutions did you explore? (Optional)

We can move the loading script for Apple and Goole script to web/index.html

melvin-bot[bot] commented 8 months ago

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

FlorianWueest commented 8 months ago

Proposal

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

The Google & Facebook Login buttons display with an initial delay from the main login page after logout.

What is the root cause of that problem?

In ' Android: mWeb Chrome', 'GoogleSignIn/index.website.js' is triggered and 'AppleSignIn/index.website.js'. In there, we await a script:

https://github.com/Expensify/App/blob/de5a9435f97ca5fee0ead16fd38bdfc71da6582a/src/components/SignInButtons/AppleSignIn/index.website.js#L128-L149

In the above code, we return null - whereas I propose we return a placeholder for the script:

https://github.com/Expensify/App/blob/de5a9435f97ca5fee0ead16fd38bdfc71da6582a/src/components/SignInButtons/AppleSignIn/index.website.js#L144-L146

Then repeat the same process for 'GoogleSignIn'.

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

Add a useState to 'GoogleSignIn':

const [scriptLoaded, setScriptLoaded] = useState(false);

Including a conditional statemement after the script where we render a placeholder div instead of null:

if (scriptLoaded === false) {
        return <PlaceholderComponent />; // Render your placeholder component here
}

What alternative solutions did you explore? (Optional)

None.

melvin-bot[bot] commented 8 months ago

@kevinksullivan, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 8 months ago

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

melvin-bot[bot] commented 8 months ago

@kevinksullivan, @alitoshmatov 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

alitoshmatov commented 8 months ago

Sorry, been busy with holidays. Review it today or tomorrow.

melvin-bot[bot] commented 8 months ago

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

alitoshmatov commented 8 months ago

@kevinksullivan So the issue here is that we are waiting for a corresponding third party scripts to load, and showing icons only after the scripts are loaded. I would say it is expected behavior. But if we want to change this we have two options:

  1. Show a loader while script is loading as (video provided by @suneox in his proposal)
  2. Show icons, but they won't be functional if script is not loaded yet and user clicks on them early.
melvin-bot[bot] commented 8 months ago

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

melvin-bot[bot] commented 8 months ago

@kevinksullivan @alitoshmatov this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 8 months ago

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

alitoshmatov commented 8 months ago

Waiting for @kevinksullivan 's take on https://github.com/Expensify/App/issues/33414#issuecomment-1873848395

kevinksullivan commented 8 months ago

Upon rereading the issue and checking the video, I don't think this is worth addressing. I don't think either solution is clearly superior to what we have today.