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.

Data requests fail on shared dashboard for connected but non-shared modules

See original GitHub issue

Bug Description

Bug bash issue: https://app.asana.com/0/1202258919887896/1202410303658780 please refer to Asana issue for background

The main admin has connected all modules, but has not given access to all of them for administrators. When the second admin logs in and goes to the shared dashboard, all of the widgets load as expected, but errors appear in the console:

Google Site Kit API Error method:GET datapoint:report type:modules identifier:analytics error:"Site Kit can’t access the relevant data from Analytics because you haven’t granted all permissions requested during setup."

The message appears for each module that they do not have permission to view.

No errors appear within the dashboard itself.

image.png

Steps to Reproduce

  1. Enable Dashboard Sharing
  2. Using the “main admin”, connect all modules, but do no grant access for all modules to others administrators. (Eg. Give all admins access to a single module like Search Console, but not Analytics or other modules)
  3. Sign in as a second admin and visit the shared dashboard
  4. All of the widgets load as expected, but errors appear in the browser console:

image


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

Acceptance criteria

  • Browser/console errors should not appear in the console when viewing the shared dashboard as a second admin that doesn’t have access to every module on the dashboard.
  • The cause of this is requests being sent to our REST API (Analytics endpoint) when Analytics is not shared with this user, so requests should not be made for modules the user doesn’t have access to on the shared dashboard.

Implementation Brief

Preventing Analytics getReport API requests if the Analytics module is not shared to view

  • To check the user has access to view Analytics, using the canViewSharedModule( 'analytics' ) selector, conditionally call the getReport, getGoals, isGatheringData, and hasZeroData selectors along with the existing conditions if there are any in the following files:

  • Note: Currently, if the user doesn’t have access to Analytics, it still shows Analytics gathering Data. Applying the changes above in the ZeroDataStateNotifications will fix the problem. Refer to the following screenshot:

Screenshot 2022-06-20 at 11 06 06 AM

  • Note: There is a request failure for Search Console settings; however, this is being implemented in #5310

  • Refer to the WIP draft PR.

Test Coverage

  • No new tests are to be added.

QA Brief

  • Follow the steps to reproduce the issue.
  • Verify there are no Analytics API request failures/errors on the console and the network tab if the user has view-only access.
  • Note: There is a request failure for Search Console settings; however, this is being implemented in #5310

Changelog entry

  • Prevent data requests on shared dashboard for connected but non-shared modules.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
aaemnnosttvcommented, Jun 16, 2022

Noting this issue is similar to https://github.com/google/site-kit-wp/issues/5310 but addresses a different cause.

This issue is caused by components which conditionally select data based on a module’s connected state, however in a view-only context this isn’t sufficient to know if that data can actually be requested or not.

e.g. ZeroDataStateNotifications

This is also not specific to the user’s role, but generally for non-authenticated users.

0reactions
wpdarrencommented, Jun 27, 2022

QA Update: ✅

Verified:

  • When on shared dashboard: Confirmed that no errors appear in the console or network.
  • When on shared dashboard: Checked that Analytics does not appear on the notification when it is not connected.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot sharing dashboards and reports - Power BI
Learn how to resolve issues when you share Power BI dashboards and reports with colleagues inside and outside your organization.
Read more >
Require module to be active as part of data request validation
Requests for inactive modules should return a 403 error, with a module_not_active code and message: Module must be active to request data.
Read more >
Solved: Shared Dashboard Loading Error
Some time ago dashboard sharing worked without any issues, but now although the error message appears to be temporary, the problem persists.
Read more >
How do I create an object reference so that a VB.NET function ...
My vb.net module with .request or .response is causing compiler error "reference to a non-shared member requires an object reference".
Read more >
Troubleshoot cross-account dashboard sharing errors with ...
These errors occur because there are permissions issues in the role that was created in the sharing account. Be sure that the sharing...
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