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

Social Auth: Introduce calypso_social_auth_attempt event #65911

Conversation

zaguiini
Copy link
Contributor

Proposed Changes

The new event calypso_social_auth_attempt will differentiate actual errors in the authentication workflow from attempts. It handles both login:

  • unknown_user when the user tries to social login with an account not yet registered;
  • user_exists when the user tries to social login with an account that was registered using an e-mail and password;

and sign up:

  • user_exists when the user tries to social sign up with an account that was registered using an e-mail and password;

Testing Instructions

See "Testing Instructions" in #64957 to set up a working wpcalypso.wordpress.com environment on your local machine.

Open the DevTools and write localStorage.setItem('debug', 'calypso:analytics'); so you can see the events being dispatched in the console.

Open https://wpcalypso.wordpress.com/log-in and try to social login with an account not yet registered with WPCOM:

  • calypso_social_auth_attempt should've been dispatched with
    • social_account_type: 'google'
    • starting_point: 'login'
    • error_code: 'unknown_user'

Open https://wpcalypso.wordpress.com/log-in and try to social login with an account that was registered using an e-mail and password:

  • calypso_social_auth_attempt should've been dispatched with
    • social_account_type: 'google'
    • starting_point: 'login'
    • error_code: 'user_exists'

Open https://wpcalypso.wordpress.com/start/user and try to social sign-up with an account that was registered using an e-mail and password:

  • calypso_social_auth_attempt should've been dispatched with
    • social_account_type: 'google'
    • starting_point: 'signup'
    • error_code: 'user_exists'

Related to #65896.

@zaguiini zaguiini requested a review from a team July 23, 2022 04:10
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 23, 2022
@matticbot
Copy link
Contributor

matticbot commented Jul 23, 2022

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~110 bytes added 📈 [gzipped])

name         parsed_size           gzip_size
entry-login       +248 B  (+0.0%)     +110 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~115 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
jetpack-connect       +257 B  (+0.0%)     +115 B  (+0.0%)
accept-invite         +180 B  (+0.0%)      +51 B  (+0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~117 bytes added 📈 [gzipped])

name                          parsed_size           gzip_size
async-load-design-blocks           +248 B  (+0.0%)     +114 B  (+0.0%)
async-load-signup-steps-user       +180 B  (+0.1%)      +51 B  (+0.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@zaguiini zaguiini added the Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change. label Jul 23, 2022
@zaguiini zaguiini requested a review from vindl July 23, 2022 04:42
@danielbachhuber danielbachhuber merged commit 5e4f248 into trunk Jul 27, 2022
@danielbachhuber danielbachhuber deleted the improve/reduce-severity-of-unknown_user-and-user_exists-events branch July 27, 2022 11:25
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Google Auth Login Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change. Social Signup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants