question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update ReportError to use module specific ids of the insufficient permissions error when we build the get help link

See original GitHub issue

Feature Description

The insufficient permissions error has no error code, so when we build a get help link only error message is used. We need to generate a fake error code for the insufficient permissions error in the ReportError component to allow the support team to redirect users to module-specific articles.

https://github.com/google/site-kit-wp/blob/0d5b670504745849367c6274776ba9adcc824358/assets/js/components/ReportError.js#L77-L81

So, instead of passing an error to the getErrorTroubleshootingLinkURL selector directly, we need to check if this error is the insufficient permissions error and add ${ moduleSlug }_insufficient_permissions error code.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Get Help link in the ReportError component for the insufficient permissions error should have module specific error code: ${ moduleSlug }_insufficient_permissions.

Implementation Brief

In assets/js/components/ReportError.js, add the following changes:

  • Map the errors array and check if the error object has an insufficient permissions error using the isInsufficientPermissionsError helper.
  • If it is, return the existing error object and add the module slug to the error code - code: ${ moduleSlug }_insufficient_permissions.
  • If it is not, then return the existing error object.

Test Coverage

In assets/js/components/ReportError.test.js, add test coverage to check the getErrorTroubleshootingLinkURL selector returns the correct URL for the insufficient permissions error with the error code for the Get help link.

QA Brief

  • Trigger the Insufficient permissions error on any module (for e.g Analytics). For e.g setup Analytics as another user and don’t grant permissions to a user.
  • Check the “Get help” URL contains the following string: error_id=analytics_insufficient_permissions where analytics is the module slug.

Changelog entry

  • Update the ReportError component to add the module slug to the insufficient error codes.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aaemnnosttvcommented, Nov 6, 2022

@felixarntz please see my comments on your PR, but TL;DR this shouldn’t be necessary 👍

1reaction
eugene-manuilovcommented, Nov 4, 2022

Another question unrelated to the code here, has the service / the CSV already been updated to account for the new error codes? Or do we need to create a task to create matching documentation?

James has already added new redirects for module specific errors to the redirects mapping document. I have created a new ticket in Asana and asked Adam to help with uploading it to production.

@felixarntz @jamesozzie the CSV with the latest error redirects mapping has been uploaded to production and new redirects work now: https://sitekit.withgoogle.com/support/?error_id=search-console_insufficient_permissions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Include a "request access" link to Analytics when a user ...
Your Google account does not have sufficient permissions to access Analytics data, so you won't be able to see stats from it on...
Read more >
Insufficient Permission message when adding a user to the ...
I receive an insufficient permission error when adding a resource to the Resource Plan. The error states 'You do not have permission to...
Read more >
Error message definitions for WebSphere® Application ... - IBM
Cause: The plug-in configuration file could not be parsed. Resolution: Ensure file was created by using WebSphere® Application server plug-in ...
Read more >
Ektron Support – Support Help Center
How to update a membership user account to become a CMS user account · Invalid Address error when using UserManager API to update...
Read more >
Update history for Microsoft Dynamics 365 Business Central
This article provides a list of builds that have been deployed to Microsoft Dynamics 365 Business Central updates after their release. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found