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
Test passwordless signup for new users, take 2 #58404
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-20652 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~1270 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~826 bytes added 📈 [gzipped])
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 (~8363 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test the changes themselves, but assuming they're unchanged from before I'm sure they're fine. I did test that /start/wpcc
loads correctly, which was the bug in the previous PR, so I'll mark this good from my point of view!
I've triggered Pre-Release tests for this change in the branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal E2E and Pre-Release E2E tests all pass. Looking good from the Quality Squad perspective!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment on the experiment name. Feel free to deploy without a review once you've updated the experiment name since everything else LGTM.
client/signup/steps/user/index.jsx
Outdated
const clientId = get( initialContext, 'query.oauth2_client_id', null ); | ||
|
||
this.setSubHeaderText( this.props ); | ||
|
||
if ( oauth2Signup && clientId ) { | ||
this.props.fetchOAuth2ClientData( clientId ); | ||
} | ||
if ( flowName === 'onboarding' ) { | ||
const experimentCheck = this.state.isDesktop | ||
? 'registration_email_only_desktop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to create a new experiment in Abacus to start clean, since this experiment already has participants from the previous run.
2c26d0a
to
e49fba4
Compare
onFormSubmit = async ( event ) => { | ||
event.preventDefault(); | ||
|
||
if ( ! this.state.email || ! emailValidator.validate( this.state.email ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the state of a component based on the current value of this.state
may potentially lead to inconsistent component state.
This is also documented in the React docs:
setState()
does not always immediately update the component. It may batch or defer the update until later. This makes readingthis.state
right after callingsetState()
a potential pitfall. Instead, usecomponentDidUpdate
or asetState
callback (setState(updater, callback)
)
The easiest way to fix this is to just change setState()
to the callback form, where it will always properly access the current state.email
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tyxla, I've run into state timing issues with useEffect, but I'm not as familiar with the class-based nuances. Quick question about this - wouldn't it be okay how it's used here since it reads the state first then sets state based on that value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen problems happening in complex components when we access it before we update the state, too. At the same time, it's very hard to reproduce those issues, so it is mostly a theoretical issue. I'll leave it up to you, but I'd suggest fixing it to ensure this.state
has the expected up-to-date value in that condition.
* Passwordless signup initial commit * Bug fix and style update * Addressing review feedback. * Implementing separate tests for mobile andd desktop viewports * Copy tweak and removing reference to unused flow * Limiting test assignment to onboarding flow * Migrating to wpcom.req * Fixing bug in non-onboarding signup flows * Changing experiment names
Changes proposed in this Pull Request
Note: This PR is a follow-up to #57846, which was merged and then reverted by #57846, due to a bug that broke non-onboarding signup flows. This PR removes the line that caused that issue.
This PR re-implements the passwordless signup, which will run as a test again the control experience. The test is configured to run via two Explat tests, one each for mobile and desktop viewports. Those test names are:
Desktop:
registration_email_only_desktop_relaunch
Mobile:
registration_email_only_mobile_relaunch
Context behind this test is at p58i-boI-p2#comment-52280.
Before:
After:
Testing instructions
control
andtreatment
variation bookmarklets to your nav bar./start/new
on your Calypso instance and assign yourself to thetreatment
variation.Related to #57846 #58359