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

Passwordless Auth Core Profiler - Add source param when sending an email #96321

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

moon0326
Copy link
Contributor

@moon0326 moon0326 commented Nov 12, 2024

This PR adds source param to sendEmailLogin function.

This is needed in WPCOM to identify the JPC flow and its product (Jetpack, Woo Payments, and Woo Order Attribution). We use this value to use a different email template for the signup and magic link. I'll open a WPCOM PR soon.

Why are these changes being made?

  • To identify JPC flow in WPCOM so we can use a different email template for the sign up and magic link.

Testing Instructions

  1. Checkout this branch locally and open config/development.json.
  2. Enable woocommerce/core-profiler-passwordless-auth feature flag and run yarn start
  3. Once the build is ready, visit this link in an incognito session.
  4. Open your browser's inspector -> Network
  5. Enter a passwordless auth enabled email and click on Continue button.
  6. Search for send-login-email request and check the payload.
  7. Confirm the payload has source value.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@moon0326 moon0326 requested review from a team, psealock and ilyasfoo November 12, 2024 20:58
@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 Nov 12, 2024
@matticbot
Copy link
Contributor

matticbot commented Nov 12, 2024

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

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

name         parsed_size           gzip_size
entry-login       +153 B  (+0.0%)      +56 B  (+0.0%)

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

Sections (~73 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
jetpack-connect       +245 B  (+0.0%)      +73 B  (+0.0%)

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 (~51 bytes added 📈 [gzipped])

name                      parsed_size           gzip_size
async-load-design-blocks       +153 B  (+0.0%)      +51 B  (+0.0%)

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.

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well for login and sign up!

One question, it seems the source field also exists on Jetpack Email me a login link flow, but it's empty. Is this expected?

Pre-approving!

8bWiln.mp4

@psealock
Copy link
Contributor

I'm only see the send-login-email request made after the second "Send link" button is clicked and the payload has source: "". Is this normal?

@moon0326
Copy link
Contributor Author

moon0326 commented Nov 13, 2024

I'm only see the send-login-email request made after the second "Send link" button is clicked and the payload has source: "". Is this normal?

I think you might be on a different page.

Where do you see Send link button 🤔 ?

You should see Connect your account first
Screenshot 2024-11-13 at 10 27 54 AM

then Check your email page.

Screenshot 2024-11-13 at 10 27 51 AM

@moon0326
Copy link
Contributor Author

moon0326 commented Nov 13, 2024

Tests well for login and sign up!

One question, it seems the source field also exists on Jetpack Email me a login link flow, but it's empty. Is this expected?

Pre-approving!

8bWiln.mp4

Thanks!

I realized we never worked on Email me a link page as it's not on Figma. We don't have it on the sign up page either. For now, I've disabled it in Disable email me a link from the login page, as it's essentially performs the same function as the main form. I'll check with Veronica to see if we can style the page.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/add-source-when-sending-magic-link-woo-jpc on your sandbox.

@moon0326 moon0326 merged commit 4990701 into trunk Nov 14, 2024
11 checks passed
@moon0326 moon0326 deleted the update/add-source-when-sending-magic-link-woo-jpc branch November 14, 2024 02:00
@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 Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants