-
Notifications
You must be signed in to change notification settings - Fork 339
Show correct category/error when Search Console email report fails due to Insufficient Permissions #12276
Copy link
Copy link
Closed
Labels
P2Low priorityLow priorityTeam SIssues for Squad 1Issues for Squad 1Type: BugSomething isn't workingSomething isn't working
Description
Bug Description
In Issue #12110, we introduced the categorisation of errors that occur during Search Console and Analytics report generation. For Analytics, the errors thrown do correctly get categorised - however, this is not the case for Search Console when the Insufficient Permissions error occurs.
Steps to reproduce
- Set up Site Kit using a Search Console property.
- Remove the property from the Google Search Console Admin Dashboard from the logged-in user's account
- Hard refresh Site Kit dashboard (clear cache and/or log out and then log in).
- The dashboard should show Insufficient Permissions errors for Search Console widgets.
- Set up a weekly email for your user and use the Tester plugin to Trigger the initiator for the weekly email.
- Check the Email logs to see that the email has failed to send for 3 times.
- Now refresh the Site Kit dashboard and check the User Settings Side sheet - it shows the generic fallback error instead of the Insufficient Permissions error for Search Console.
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When an email report fails due to the user having "Insufficient Permissions" for Search Console, the "Search Console Insufficient Permissions" error from the PUE Errors Spreadsheet should be rendered in the Email Reporting User Settings Side Panel.
Implementation Brief
The below IB has already been implemented in the attached PR.
- In
includes/Core/Email_Reporting/Email_Reporting_Data_Requests.php, within thecollect_search_console_payloads, remove theis_wp_error()check as the errors are keyed by the name of the request. - In
includes/Modules/Search_Console/Email_Reporting/Report_Request_Assembler.php, within themap_responses()method, after thenormalize_response_resultis run, check if result is a WP_Error. If it is, simply return the result (the WP_Error) as the payload.
Test Coverage
- No new tests required.
QA Brief
- Set up Site Kit using a Search Console property.
- Remove the property from the Google Search Console Admin Dashboard from the logged-in user's account
- Hard refresh Site Kit dashboard (clear cache and/or log out and then log in).
- The dashboard should show Insufficient Permissions errors for Search Console widgets.
- Set up a weekly email for your user and use the Tester plugin to Trigger the initiator for the weekly email.
- Check the Email logs to see that the email has failed to send for 3 times.
- Refresh the Site Kit dashboard and check the User Settings Side sheet
- It should show the error for "Insufficient Permissions error for Search Console", eg:
We were unable to generate your report due to insufficient permissions in Search Console. To fix this, contact your administrator or get help. Report delivery will automatically resume once the issue is resolved.
Changelog entry
- Show a Search Console-specific error message in Email reporting when a permissions issue is encountered.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Low priorityLow priorityTeam SIssues for Squad 1Issues for Squad 1Type: BugSomething isn't workingSomething isn't working