-
Notifications
You must be signed in to change notification settings - Fork 295
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
Clarify proxy request error message #5038
Comments
IB ✅ |
QA Update:
|
@mohitwp please could you have a look at this ticket since it is non-dashboard sharing. Read the QAB, and see if you can recreate the error message. |
@wpdarren I tried to replicate issue following the steps mentioned under QAB. |
@jimmymadon @aaemnnosttv any ideas how we could trigger the error message? 🤔 I've tried a few different ways. |
@wpdarren I tried this again yesterday and was able to get the error after disabling the Wi-fi on my Mac and then immediately clicking on the CTA. For some reason, Chrome does not think I am offline when I do this. However, when I use the throttle feature in Chrome Dev Tools, it also shows me the "No Internet" Chrome Error page. At this stage, I think we could add the QA:Eng label and let an engineer test this by preventing a successful request using a Firewall rule / Proxy software. Even when using Proxyman, completely blocking the request causes a "Connection closed" Chrome error instead of the WP Error. Mocking a wp_error as a response to the request here is something I have already done locally - so not sure if doing this in QA:Eng is the right way to proceed. |
@jimmymadon the easiest way would be to use a filter to override the request to the proxy but this is only possible for requests that are made via WP HTTP (i.e. One option that just came to mind would be to use the |
QA Update:
|
@wpdarren It is expected to have the error message change to whatever is returned in the message from WP_Error which now is "user blocking requests". It does pass the AC. I do not get the Query Monitor message in my tests as I do not have that plugin. So this should be sufficient. |
When the proxy request to register the site or sync site fields fails, the plugin currently shows a generic message: The request to the authentication proxy has failed. Please, try again later.
This message lacks any detail about the actual error that occurred, so this should be enhanced.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
WP_Error
, the message should include detail from there as follows: The request to the authentication proxy has failed with an error: %sWP_Error
's error message if not empty, or its error code otherwise (as a fallback in case there's no error message).filter_var
call, the original message can remain.Implementation Brief
includes/Core/Authentication/Setup.php
, within thehandle_action_setup_start()
method:$oauth_setup_redirect
is aWP_Error
.$oauth_setup_redirect
is aWP_Error
, get the error message usingWP_Error::get_error_message()
and if it is empty, get the error codeWP_Error::get_error_code()
and die with the message as per the AC.Test Coverage
Setup_Test::test_handle_action_setup_start__syncs_site_fields()
that returns a WP_Error when a request to the Google Proxy server is made. It can be calledtest_handle_action_setup_start__dies_if_proxy_server_errors()
. The logic to mock a WP_Error when an HTTP request is made can be similar to theAuthenticationTest::test_cron_update_remote_features__wp_erro()
method.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: