Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Aug 11, 2025

Part of WOOMOB-965

Description

This PR updates the web connection flow:

  • Replaces the site connection URL to {site_url}/wp-admin/admin.php?page=jetpack to avoid forcing users to update their plugin.
  • Adds workaround to reuse the WPCom credentials when loading the authorization page.
  • Restores site connection handling for cookie-nonce authenticated users that was removed in REST API: Integrate Jetpack setup flow after login #9113

Testing steps

Follow TC7 in pe5sF9-42S-p2 to confirm that Jetpack connection through the web flow works for outdated plugin.

Testing information

From my testing, I could not make the jetpack/v4/connection/data to not return isRegistered - so I use an up-to-date Jetpack plugin on my JN site and use Proxyman to update the response to not return isRegistered.

Screenshots

Simulator.Screen.Recording.-.iPhone.16.-.2025-08-11.at.15.52.04.mp4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 23.1 milestone Aug 11, 2025
@itsmeichigo itsmeichigo added type: task An internally driven task. category: jetpack Specific to Jetpack sites. labels Aug 11, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 11, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16001-dc3dc48
Version23.0
Bundle IDcom.automattic.alpha.woocommerce
Commitdc3dc48
Installation URL61ad8tp48m2r8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review August 11, 2025 10:51
@hichamboushaba hichamboushaba self-assigned this Aug 12, 2025
Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Nice work @itsmeichigo, the scenario works well for both:

  • Connecting an existing store from the site picker.
  • For Application Passwords where the user used a WebView for authorization.

But the flow fails for Application Passwords where native login was used, check my comment below.

Also, a very minor nit, we show validating for the connection step before the user handles the connection, normally it should be shown only after the connection was established, and we are validating it, notice the difference between Android and iOS:

Android iOS
Screen_recording_20250813_161423.mp4
Simulator.Screen.Recording.-.iPhone.16.-.2025-08-13.at.15.58.03.mp4

As said above, this is very minor, so I wouldn't spend a lot of time on it.

Comment on lines 267 to 272
let usingApplicationPassword: Bool = {
if case .some(.applicationPassword) = stores.sessionManager.defaultCredentials {
return true
}
return false
}()
Copy link
Member

Choose a reason for hiding this comment

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

This condition doesn't work as expected when the user is signed in using site credentials natively, as we'll get .wporg credentials in this case:

Image

The same issue also occurs in tracking here and I missed during the review of the previous PR (sorry).

@itsmeichigo
Copy link
Contributor Author

Thank you Hicham for spotting the issues! I addressed them in subsequent commits, this PR is ready for another look 🙏

Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Nice work @itsmeichigo, :shipit:

@itsmeichigo itsmeichigo merged commit fc02c50 into trunk Aug 15, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-965-web-jetpack-connection-update branch August 15, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: jetpack Specific to Jetpack sites. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants