Skip to content

My Jetpack: Stop the dashboard crashing when one notice replaces another - #53399

Closed
xavier-lc wants to merge 2 commits into
trunkfrom
fix/my-jetpack-global-notice-hook-crash
Closed

xavier-lc wants to merge 2 commits into
trunkfrom
fix/my-jetpack-global-notice-hook-crash

Conversation

@xavier-lc

@xavier-lc xavier-lc commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes MYJP-350

Since #52290, GlobalNotice renders @wordpress/ui's Notice.Root without a spokenMessage, so Root serializes its children with renderToString() mid-render and runs their hooks as its own. When a higher-priority notice with a different shape replaces the one shown, the hooks stop lining up and the dashboard crashes with "Cannot read properties of undefined (reading 'refs')".

Proposed changes

  • Pass a string spokenMessage to Notice.Root in GlobalNotice: the title, plus the message when it's a string. Newsletter and Premium Analytics already do the same.

Related product discussion/links

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

No.

Testing instructions

  • jp test js packages/my-jetpack. global-notice.test.jsx has a titled notice replacing an untitled one, which fails without this change.
  • Where it was seen: a Docker site with the Jetpack plugin active but unbuilt, Boost built, and My Jetpack forced on offline (jetpack_my_jetpack_should_initialize). My Jetpack → Overview showed "Something went wrong" before this change, and shows the "Missing site connection" notice after.
Before After
My Jetpack Overview showing the error boundary: Something went wrong, Cannot read properties of undefined (reading 'refs') My Jetpack Overview rendering with the Missing site connection notice and its Connect your site button

Before, the Overview is replaced by the error boundary. After, it renders with the "Missing site connection" notice (title, message and "Connect your site" button). The spinners on the product cards come from the offline local site, not this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QqfKRQfxuwm723Y1prq8mM

Xavier Lozano Carreras and others added 2 commits October 9, 2026 11:32
@wordpress/ui's Notice.Root defaults spokenMessage to its children and
serializes them with renderToString() during its own render, so the
compound subcomponents' hooks (Title, Description, Actions, CloseIcon)
run on Root's fiber. When GlobalNotice swaps to a notice with a
different shape (title, actions or close button added or removed), the
hook list no longer lines up and the render throws. Pass a plain-string
spokenMessage so nothing is serialized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QqfKRQfxuwm723Y1prq8mM
@xavier-lc
xavier-lc requested a review from a team as a code owner October 9, 2026 09:40
@xavier-lc xavier-lc self-assigned this Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/my-jetpack-global-notice-hook-crash branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/my-jetpack-global-notice-hook-crash

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Tests] Includes Tests labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 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!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Stats Data plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx 9/45 (20.00%) 2.22% -1 💚

Full summary · PHP report · JS report

@xavier-lc

Copy link
Copy Markdown
Contributor Author

Closing: the crash comes from @wordpress/ui's Notice.Root serializing its children for its default screen-reader announcement. Upstream removed that announcement in 0.24.0 (WordPress/gutenberg#82737), and the monorepo update (#53004) brings it in, so this workaround won't be needed once that lands.

@xavier-lc xavier-lc closed this Oct 9, 2026
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Oct 9, 2026
@xavier-lc
xavier-lc deleted the fix/my-jetpack-global-notice-hook-crash branch October 9, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Tests] Includes Tests [Type] Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant