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

Present a clearer message if the site's XML-RPC is blocked or the site cannot be reached #3767

Closed
3 tasks done
shiki opened this issue Mar 30, 2021 · 3 comments · Fixed by wordpress-mobile/WordPress-Login-Flow-Android#67, #4799 or #4913
Assignees
Labels
category: parity Match what's supported by the other platform. feature: login Related to any part of the log in or sign in flow, or authentication. priority: high Affects lots of customers substantially, but not critically. type: bug A confirmed bug.

Comments

@shiki
Copy link
Member

shiki commented Mar 30, 2021

Found in woocommerce/woocommerce-ios#3883 (comment)

Describe the bug

The app responds with an indistinct message when logging in with a site that has one of these conditions:

Here is an example result:

To Reproduce

XML-RPC

This will probably work → How to Disable XML-RPC in WordPress

Offline

  1. Enter the site address.
  2. After pressing “Continue”, quickly disable the internet connection.
  3. The app will say “Check that the site URL entered is invalid”.

Expected behavior

I would expect a more specific message so that I can troubleshoot further.

This iOS PR shows what messages we should display: woocommerce/woocommerce-ios#3957.

XML-RPC

If the site blocks XML-RPC, we can be more specific. Right now, iOS can present a lot of them depending on how the site reacts. But we could probably just prioritize these error messages for XML-RPC problems:

Couldn't connect. Your host is blocking POST requests, and the app needs that in order to communicate with your site. Contact your host to solve this problem.

Couldn't connect. We received a 403 error when trying to access your site's XMLRPC endpoint. The app needs that in order to communicate with your site. Contact your host to solve this problem.

Couldn't connect. Required XML-RPC methods are missing on the server.

Those “Contact your host” messages are good self-troubleshooting hints for our customers.

Offline

If offline, we should at least say “The Internet connection appears to be offline.”


iOS: woocommerce/woocommerce-ios#3891

@shiki shiki added type: bug A confirmed bug. Login labels Mar 30, 2021
@shiki shiki changed the title Present a clearer message if the site is password-protected via basic HTTP auth Present a clearer message if the site is password-protected or XML-RPC is blocked Mar 30, 2021
@shiki shiki added the priority: high Affects lots of customers substantially, but not critically. label Mar 30, 2021
@shiki shiki changed the title Present a clearer message if the site is password-protected or XML-RPC is blocked Present a clearer message if the site is password-protected, XML-RPC is blocked, or cannot be reached Mar 30, 2021
@anitaa1990 anitaa1990 added this to Needs Triage in Continuous Improvements via automation Apr 1, 2021
@designsimply designsimply added feature: login Related to any part of the log in or sign in flow, or authentication. and removed Login labels May 4, 2021
@shiki shiki added the category: parity Match what's supported by the other platform. label Jun 24, 2021
@shiki
Copy link
Member Author

shiki commented Jun 24, 2021

Related: #3977

@anitaa1990
Copy link
Contributor

anitaa1990 commented Jun 25, 2021

Just an update on the testing steps:

Password-protected
I performed similar steps with my site:
Create a WooCommerce site that is connected to Jetpack.
I added a basic HTTP auth to the site. Here is an example for Nginx. Ask @shiki if you need help with setting up a site.
Log in by clicking on "Enter your Store Address" and enter the site address.

I use the WP Basic authentication plugin on my test site to enable HTTP auth.

Also @shiki what is the intended behaviour in this scenario? To display an error message? To allow folks to login via HTTP Auth?

So when a site address is entered, the app calls the /rest/v1.1/connect/site-info/ endpoint and this returns the below response:

{
  "exists": true,
  "isWordPress": true,
  "hasJetpack": true,
  "isJetpackActive": false,
  "isJetpackConnected": false,
  "isWordPressDotCom": false,
  "urlAfterRedirects": "https://huge-capybara.jurassic.ninja",
  "jetpackVersion": "9.8.1",
  "skipRemoteInstall": false
}

It shows that jetpack is not connected, even though it is. So how do we know when to display the HTTP Auth dialog? I get the same error when XML-RPC is blocked too 🤔 So not sure how to differentiate between the different errors that happen.

Sorry, didn't mean to pick on you @shiki but since you worked on the iOS side wanted to better understand the intended behaviour 😅

There is also a fieldguide with test sites to test all the scenarios mentioned in this issue:
testing-self-hosted-discovery/

@shiki shiki changed the title Present a clearer message if the site is password-protected, XML-RPC is blocked, or cannot be reached Present a clearer message if the site's XML-RPC is blocked or the site cannot be reached Jun 25, 2021
@shiki
Copy link
Member Author

shiki commented Jun 25, 2021

Thanks for digging in, @anitaa1990. And thanks for the poke. This issue wasn't very descriptive, was it? 😅

Also @shiki what is the intended behavior in this scenario? To display an error message? To allow folks to login via HTTP Auth?

I only have questions about this. I did not have enough time to get this done for iOS. I created a separate issue for Android so we can tackle it separately. I have a feeling that sites protected with basic auth are rare so it's probably better to do this later.

#4282

As for the other issues mentioned here, I updated the description ☝️ so it's clearer what needed to be done. Well, I hope it's clearer. So let me know if it's not.

I get the same error when XML-RPC is blocked too

That's interesting. I have not looked into the details of how this works. I only made sure that the WordPressKit-iOS errors are propagated to the UI. For iOS, there is a XMLRPCValidator which handles all of these. And then I just made sure that these errors are presented when they happen: WordPressOrgXMLRPCValidatorError.

It looks like there is a similar validator and error enum in FluxC: SelfHostedEndpointFinder and DiscoveryError. Could we possibly use these?

Sorry, didn't mean to pick on you @shiki but since you worked on the iOS side wanted to better understand the intended behaviour 😅

No problem! It's my fault because I didn't update this issue. 🙂

I just made sure that the errors are not generic and a bit more actionable. This PR shows what's been done: woocommerce/woocommerce-ios#3957. I also updated the description of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: parity Match what's supported by the other platform. feature: login Related to any part of the log in or sign in flow, or authentication. priority: high Affects lots of customers substantially, but not critically. type: bug A confirmed bug.
Projects
No open projects
4 participants