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

More useful errors and logging when sync fails. #3133

Merged
merged 2 commits into from
Nov 22, 2022
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Nov 15, 2022

Description of the Change

Adds more useful error messages with a troubleshooting URL to the log when a sync fails. Additionally the raw response is logged to the console as an error for easier debugging.

Closes #3131

How to test the Change

  • When attempting a sync after logging out in another tab, the message "'Permission denied. Reload the sync page and try again." should appear.
  • When attempting a sync, if a 500 error or similar occurs the message "Something went wrong" should appear, with a troubleshooting URL. Opening the sync page and then editing a plugin to deliberately cause a 500 error before clicking sync can help with testing this.
  • If a 200 response is returned but with invalid JSON somehow, the message "Unable to parse response" should appear, with a troubleshooting URL. A quick way to test this is to modify action_wp_ajax_ep_index() to return a regular string.

For the last two messages an error should appear in the console with the raw response to the request.

Changelog Entry

Added - Extra debugging information in the browser console when syncing fails and more useful error messages with a troubleshooting URL.

Credits

@JakePT

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT added the module:sync Issues related to the Sync functionality label Nov 15, 2022
@JakePT JakePT added this to the 4.4.0 milestone Nov 15, 2022
@JakePT JakePT self-assigned this Nov 15, 2022
@felipeelia felipeelia merged commit e590bc7 into develop Nov 22, 2022
@felipeelia felipeelia deleted the feature/3131 branch November 22, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:sync Issues related to the Sync functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log errors in response to Sync requests
2 participants