-
Notifications
You must be signed in to change notification settings - Fork 291
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
Cannot read property 'clicks' of undefined
error on Search Console widget-based dashboard
#3348
Comments
Cannot read property 'clicks' of undefined
error on Search Console dashboardCannot read property 'clicks' of undefined
error on Search Console widget-based dashboard
IB ✅ @aaemnnosttv @eclarke1 @fhollis Let's squeeze this into the current sprint and upcoming release. A PR is already underway so this should be doable. If needed maybe we can postpone #3272 for the next sprint? |
QA Update: Pass ✅As per conversation with @aaemnnosttv QA have run through a first pass for this ticket.
Screenshot 1 - Screenshot 2 - Screenshot 3 - Screenshot 4 This testing was done on widget-based and legacy views/dashboards including different date ranges. |
Thanks @wpdarren ! @felixarntz I asked @wpdarren to give this a first pass earlier in the week if they had capacity since we had some extra time while you were away. Given the timeliness around the release and the larger footprint of the PR I thought we could perhaps iterate on any regressions while we were waiting for the next round of CR. Luckily none were found 😄 I think the only changes to the branch were additions to the test since Darren tested so this is probably good to go right to approval but I'll send it into QA just in case there is anything left to do. |
@aaemnnosttv Sounds good, let's bypass another round of QA then. cc @wpdarren |
Bug Description
When viewing the Search Console dashboard, it is possible to encounter the following fatal error:
The problem happens when the API returns an odd number of rows for a request that includes the previous range for comparison. This leads to an off-by-one situation when iterating over the previous data due to the way the rows are sliced.
site-kit-wp/assets/js/modules/search-console/components/module/ModuleOverviewWidget/Stats.js
Lines 108 to 115 in db4d644
The error happens right here because the
index
in the array ofprevious
rows does not exist (because it was not returned from the API:site-kit-wp/assets/js/modules/search-console/util/site-stats-data.js
Line 65 in db4d644
This is likely a matter of timing regarding when data is available as it is the very last (most recent) row which is missing
This request was for a 28 day range + compare which should have returned 56 rows (28 * 2), but instead it returned 55 (54 + 1 for the 0th row).
Steps to reproduce
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Test Coverage
partitionReport
Visual Regression Changes
QA Brief
Changelog entry
Cannot read property 'clicks' of undefined
JS error that could occur when an uneven number of Search Console report rows was returned.The text was updated successfully, but these errors were encountered: