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
Retry all selectors for combined widgets in ReportError state. #6406
Comments
ACs here are good 👍🏻 |
@hussain-t Are you planning to work on this soon? If not, can you please unassign yourself so someone else can pick up? Thank you! |
@bethanylang, I'll work on it this week. Thanks! |
@hussain-t could I pick this up this week also? I'm looking for a number of IBs while a lot of the EB is blocked? |
@benbowler, sure 👍 |
@benbowler, I think that suggested approach in IB is slightly off from what we need here. If we dispatch that action, we will invalidate all getReport selectors even those that haven't failed. I think we need a better approach here. I have to ideas of the top of my head to solve this problem, but all of them are not perfect:
|
@eugene-manuilov as we store all of the errors in the store, how about an action like |
@benbowler that will affect all of unrelated reports as well. Let's say there are errors for the All traffic widget and popular pages one. If we go with your |
@eugene-manuilov yes I see what you mean. I'll draft a new IB shortly based on either of your approaches. |
Hi @benbowler, just chipping in to say I think it would be preferable to take the approach of passing in options or a set of selector names and args to |
@techanvil, this basically means that in the All traffic widget when we render the report error component in the pie chart component, we need to pass options that we use for the users graph as well, and for the report error component in the user graph component we need to pass report options that we use for the pie chart component, right? This makes us need to cross reference report options in different components which makes more mess and reduces maintainability. Just imagine if we need to cross reference report options for 3 or more report errors... |
@eugene-manuilov, in practical terms I think it would just mean passing an array of errors into Actually, looking into this has made me realise we should reconsider this issue a bit. First off, I should point out that when I initially created the issue, I made a mistake in how I described it. It's not the case that "the widgets in a widget area are combined due to all being in the Anyhow, rather than combining anything, we are simply rendering a site-kit-wp/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js Lines 301 to 310 in ab9d76b
site-kit-wp/assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/index.js Lines 309 to 318 in ab9d76b
So, with the widget errors clearly not being in a combined state, if we take the approach of retrying all of the widget's report errors while only showing one of the errors, we can end up not showing some of the errors to the user, which is not really the intention here. Note that site-kit-wp/assets/js/components/ReportError.js Lines 92 to 101 in ab9d76b
Its child site-kit-wp/assets/js/components/ReportErrorActions.js Lines 103 to 113 in ab9d76b
With that in mind, I think the thing to do here for the All Traffic widget is to pass all of the errors into diff --git a/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js b/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js
index 7e20a3d3c9..8e7338cb6f 100644
--- a/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js
+++ b/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js
@@ -298,12 +298,18 @@ function DashboardAllTrafficWidgetGA4( props ) {
setValue,
] );
+ const retryableErrors = [
+ pieChartError,
+ totalUsersError,
+ userCountGraphError,
+ ].filter( Boolean );
+
if ( pieChartError ) {
return (
<Widget>
<WidgetReportError
moduleSlug="analytics-4"
- error={ pieChartError }
+ error={ retryableErrors }
/>
</Widget>
); As for the Search Funnel widget, I don't think we should do anything here at this point, because the top level error is for the Search Console module, while the error shown in the Overview is for the Analytics module, and we don't currently have a design or pattern for showing errors for multiple modules at the same time. Maybe this could be something to address as a separate issue. Lines 85 to 92 in ab9d76b
What do you think? |
Thanks for explaining this, @techanvil. Yes, I think we can go with what you suggested. @benbowler, could you please update your IB? |
IB updated. |
Thanks @benbowler, the IB LGTM ✅ |
QA Update ✅
I noticed the another issue and created a separate ticket for that #8434 Recording.837.mp4 |
Feature Description
When the widgets in a widget area are combined due to all being in the
ReportError
state, it's necessary to individually retry for each of the errors, which is a bit of a confusing user experience as can be seen in the screen capture below.It would be a UX improvement if the combined Retry button would retry all of the underlying errored selectors.
The Tweak Chrome extension is being used here to simulate an error for all Analytics report requests.
combined-report-error.mp4
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
DashboardAllTrafficWidgetGA4
, if multiple errors occur, all retryable error should be retried, when clicking the "Retry" button on the combined error message.Implementation Brief
assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js
grouping the retryable errors from each section of the widget:assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidgetGA4/index.js
to pass the new grouped errors to the errors prop of theWidgetReportError
.Test Coverage
QA Brief
Note: since the issue was reported the widget has been updated to use the
analytics-4
module so the URL pattern in the tweak extension should be updated to:.*/wp-json/google-site-kit/v1/modules/analytics-4/data/report?.*
Changelog entry
The text was updated successfully, but these errors were encountered: