Issue/1482 step3 handle discovery error changes#1515
Conversation
…os from the calling fragment
… utilise LoginBaseDiscoveryFragment
…very process again
…e/1482-step3-discovery-error-changes
Error TypeErrorDangerfileError TypeErrorDangerfileGenerated by 🚫 dangerJS |
|
You can test the changes on this Pull Request by downloading the APK here. |
AmandaRiu
left a comment
There was a problem hiding this comment.
@anitaa1990 finished the first review round and left a code comment. I tried testing through the scenarios using our test sites page but couldn't get to the FragmentLoginDiscoveryError view. I tried to sign in with a WP test site that had HTTP AUTH required, but couldn't get past the first screen because CONNECTED-SITE-INFO was flagging it as a site that was not a WordPress site. Logging in with a site that required an SSL cert didn't give me this screen either - it would just drop me in the "Jetpack Required" screen.
Do you have some tests sites I can use?
WooCommerce/src/main/res/layout/fragment_login_discovery_error.xml
Outdated
Show resolved
Hide resolved
|
Thanks for the quick review @AmandaRiu. I've invited you to three of my test sites. The invites are sent to your official email account. Do let me know if you face any issues. I've also updated the PR description with the testing steps and explanation. PR ready for another round 👍 |
…ors since it can return a false negative
|
@anitaa1990 Thank you for the test accounts and testing steps! All of them worked great except for this one: Scenario II: Login to a site with missing rsd tags. With that scenario I never get the "Jetpack required" view. It allows me to get all the way to the "Not a woocommerce site" view. |
|
Hey @AmandaRiu, thanks for testing!
Ah, yes! I was testing SSL certification with that test site and had to revoke the changes I made that caused this error. I forgot yo update you 🤦♀️ I’ve set an invalid certificate to the site now so you should be able to see the below behaviour when you try it now. The steps to reproduce this are updated in the PR as well under I also faced another error when trying to login with a site that has the
Let me know if you face any other issues! PR ready for another round 👍 |
AmandaRiu
left a comment
There was a problem hiding this comment.
Brilliant work @anitaa1990! I've run through the new test scenarios and they were all successful! 🎆 Approving this PR ![]()


Partially fixes #1482. This PR completes the third step of the Jetpack sign in with self credentials as defined in the master thread here.
Changes:
If a discovery error takes place for a site,CONNECT_SITE_INFOAPI returns that Jetpack does not exist, even when Jetpack is available and connected on the site. In order to address this issue, the logic for discovery errors has being modified as follows:Try again. In order to avoid confusion and displaying No jetpack available when it is, we are using theCONNECT_SITE_INFOAPI to verify if Jetpack is installed/active/connected.LoginDiscoveryErrorFragmentthat is displayed when a discovery error takes place for a site that has jetpack available.Sign in with WordPress.comredirects to the email screen.Read our troubleshooting tipsredirects to this link inside a webview.Try againredirects to the site credentials screen.LoginSiteAddressFragmentto theLoginBaseDiscoveryFragment.Notes:
Screenshots
Logging into a site with HTTP AUTH required when Jetpack is NOT available:
(LEFT: When jetpack is still not installed and user clicks on Try AGAIN button)
. 
(RIGHT: When jetpack is installed when user is on the screen and clicks on TRY AGAIN button)
Logging into a site with XMLRPC missing when Jetpack is available:
Logging into a site with missing rsd tags:
Logging into a site with SSL Certificate error :
Logging into a site with the XML-RPC request is blocked :
Different discovery error messages:
(LEFT: HTTP AUTH required . RIGHT: SSL certificate needed)
. 
(LEFT: XMLRPC errors . RIGHT: All other generic errors)
. 
Testing:
Scenario I: Login to a site where the XMLRPC file is renamed.
(This scenario is applicable to the following discovery errors:
MISSING_XMLRPC_METHOD,XMLRPC_BLOCKED,XMLRPC_FORBIDDEN,GENERIC_ERROR,NO_SITE_FOUND)wp-admin.Next.hasJetpack: true,isJetpackActive: false,isJetpackConnected: false.Login with site credentialsand enter username + password.We were unable to access the XMLRPC file on your site. You will need to reach out to your host to resolve this..Try againredirects to the Username + password screen.Read our troubleshooting tipsredirects to a webview from this link.Helpopens the help page.Sign in with Wordpress.comredirects to the Email screen and you are able to login successfully to the app using wp.com email.Scenario II: Login to a site with SSL Certificate required error:
(This scenario is the same as the above scenario but with different discovery error type:
ERRONEOUS_SSL_CERTIFICATE)wp-admin.Next.Login with site credentialsand enter username + password.We were unable to access your site because of a problem with the SSL Certificate. You will need to reach out to your host to resolve this..Try againredirects to the Username + password screen.Read our troubleshooting tipsredirects to a webview from this link.Helpopens the help page.Sign in with Wordpress.comredirects to the Email screen and you are able to login successfully to the app using wp.com email.Scenario III: Login to a site where HTTP AUTH plugin is installed and activated.
wp-admin.HTTP Authplugin from the same page. This enables HTTP Auth to the site.Next.Login with site credentialsand enter username + password.wp-adminand deactivateHTTP Authbefore activating and connecting Jetpack (This is because Jetpack does not support HTTP Auth plugin and you will only be able to connect Jetpack if HTTP Auth plugin is deactivated).Nextand verify that you are successfully redirected to the Magic link screen.Scenario IV: Login to a site where the XMLRPC request is blocked.
Disable XML-RPC.We were unable to access the XMLRPC file on your site. You will need to reach out to your host to resolve this..Update release notes:
RELEASE-NOTES.txtif necessary.@AmandaRiu, I assigned the PR to you since you have reviewed the last two 😄 Could you trouble you for one more review please? Thank you!!