Repository navigation
Conversation
@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
…pack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QqfKRQfxuwm723Y1prq8mM
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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. |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Closing: the crash comes from |
Fixes MYJP-350
Since #52290,
GlobalNoticerenders@wordpress/ui'sNotice.Rootwithout aspokenMessage, so Root serializes its children withrenderToString()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
spokenMessagetoNotice.RootinGlobalNotice: 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.jsxhas a titled notice replacing an untitled one, which fails without this change.jetpack_my_jetpack_should_initialize). My Jetpack → Overview showed "Something went wrong" before this change, and shows the "Missing site connection" notice after.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