Wordpress-ios: Stats: Remote install is tried (and fails) instead of recognizing Jetpack-connected sites

Created on 9 Sep 2019  Â·  9Comments  Â·  Source: wordpress-mobile/WordPress-iOS

Expected behavior

If I log in to a Jetpack-connected site using its site address and self-hosted credentials, I expect the Stats section to recognize that Jetpack is installed and connected and ask me to log in to the connected WordPress.com account.

Actual behavior

The Stats section offers to install Jetpack (remote install) and then fails with a SITE_IS_JETPACK error in the logs.

Steps to reproduce the behavior

  1. Start logged out of the app.
  2. Log in to a self-hosted site (where Jetpack is already installed and connected to WordPress.com) using the site address and self-hosted credentials.
  3. Go to My Sites > Stats.
  4. Note that Stats shows the "Install Jetpack" prompt even though Jetpack is already installed on the site. Select "Install Jetpack."
  5. On the next screen, select "Continue."

Result: A screen appears saying "There was a problem" with a Retry button. The logs shows an event install_jetpack_remote_failed with the error message SITE_IS_JETPACK.

Screenshots

Tested on [iPhone XS], iOS [13.1 beta], WPiOS [13.2.1.20190905 beta]

Related user reports (internal refs): 2327408-zen, 2326968-zen
h/t @charliescheer for raising the issue.

Jetpack Stats [Pri] High [Type] Bug

Most helpful comment

Yes there's a check at the beginning and the UI responds to jetPack.isConnected.
But if this fails we can easily handle SITE_IS_JETPACK in JetpackRemoteInstallViewController where we check if the error is error.isBlockingError.

All 9 comments

I actually can't tell from the Jetpack Remote Install designs and implementation if this case where a site is already Jetpack-connected was considered and handled (and this is a regression) or if we never handled this case. @danielebogo do you remember?

@rachelmcr not at the moment. But it's definitely something we can do with this and other error type.

Thanks for taking a look!

It looks like WordPress/Classes/ViewRelated/Jetpack/Login/JetpackLoginViewController.swift still has the details for the login screen I'd expect to see if Jetpack is already connected, as illustrated in the screenshot in https://github.com/wordpress-mobile/WordPress-iOS/pull/8567.

I'll add this to groundskeeping as I don't think there's any new design needed here — we just need to be sure to check for Jetpack on the site and direct users to that screen when Jetpack is already installed and connected, instead of the remote install prompt.

Yes there's a check at the beginning and the UI responds to jetPack.isConnected.
But if this fails we can easily handle SITE_IS_JETPACK in JetpackRemoteInstallViewController where we check if the error is error.isBlockingError.

@astralbodies, you mentioned this might be connected to some recent API changes on WordPress.com. I agree it sounds like it might be, but I'm unable to reproduce this issue on my site or any API oddness with the reported sites (though it's been a while since the reports about the problem came in.)

So, at the moment, it doesn't look like an API problem, but I'm happy to investigate more if anyone has examples of more broken sites.

I _think_ this might have been resolved on the API side by the latest Jetpack release (7.7.2). @planarvoid, does this sound like the same thing? If so, I guess we can close the issue.

I think this is indeed related. The issue was that wp.org was not returning the flag that indicates that Jetpack plugin is installed. The app thought that Jetpack is not installed and offers Jetpack installation again. The server responds with an error that Jetpack is already installed. This was fixed with Jetpack 7.2.2 (I think it was introduced in Jetpack 7.1). This is the fix of the Jetpack plugin - https://github.com/wordpress-mobile/WordPress-Android/pull/10534#pullrequestreview-294197269

The Stats section is an important area of the app. Can we please re-test using the steps provided to check on this issue as part of our next maintenance rotation?

Note: the latest stable Jetpack release was 8.3 on 2020-03-03.

Appears to be resolved. I now see the Log In view.

jp_login

Was this page helpful?
0 / 5 - 0 ratings