Skip to content

Premium Analytics: fix dashboard global error provider#50020

Merged
chihsuan merged 1 commit into
trunkfrom
codex/premium-analytics-global-error-provider
Jun 29, 2026
Merged

Premium Analytics: fix dashboard global error provider#50020
chihsuan merged 1 commit into
trunkfrom
codex/premium-analytics-global-error-provider

Conversation

@nerrad

@nerrad nerrad commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

  • Wrap the live Premium Analytics dashboard route in GlobalErrorProvider so dashboard widgets can call useGlobalError() without logging the provider warning.
  • Add the dashboard route package dependency needed for the provider import.
  • Add a Premium Analytics changelog entry.

This PR is needed because the live dashboard route rendered WidgetDashboard directly, while dashboard widgets use the shared widget error hook, which reads from useGlobalError(). Storybook already wrapped dashboard-hosted widget stories in GlobalErrorProvider, so the warning only appeared in the live dashboard route.

The problem was surfaced while testing the current Premium Analytics dashboard on trunk: the browser console reported useGlobalError was called outside of GlobalErrorProvider. Wrap your component tree with GlobalErrorProvider. Tracing that warning showed useWidgetError() calling useGlobalError() from widget code, with the live route missing the provider wrapper.

Related product discussion/links

  • None.

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Run pnpm --filter @automattic/jetpack-premium-analytics typecheck.
  • Run pnpm --filter @automattic/jetpack-premium-analytics build.
  • Open the Premium Analytics dashboard with widgets available and confirm the browser console no longer logs useGlobalError was called outside of GlobalErrorProvider.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 26, 2026
@nerrad

nerrad commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

I guess the open question from me regarding this is whether the existing ErrorProvider is what will actually be used in this iteration of anaytics (or does it need improvements as well). Feel free to review/improve and merge since I will be away this week.

@nerrad nerrad marked this pull request as ready for review June 27, 2026 13:16
@nerrad nerrad requested review from a team as code owners June 27, 2026 13:16

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! @nerrad LGTM. 🚢

@chihsuan chihsuan merged commit 7fc5738 into trunk Jun 29, 2026
73 checks passed
@chihsuan chihsuan deleted the codex/premium-analytics-global-error-provider branch June 29, 2026 02:51
@github-actions github-actions Bot removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants