From 270c6ad1528ba67fbb308a02a1ae68f65fa3e3b0 Mon Sep 17 00:00:00 2001 From: Xavier Lozano Carreras Date: Fri, 9 Oct 2026 11:32:07 +0200 Subject: [PATCH 1/2] My Jetpack: Stop the dashboard crashing when one notice replaces another @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 Claude-Session: https://claude.ai/code/session_01QqfKRQfxuwm723Y1prq8mM --- .../_inc/components/my-jetpack-screen/index.jsx | 8 +++++++- .../test/global-notice.test.jsx | 17 +++++++++++++++++ .../fix-my-jetpack-global-notice-hook-crash | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 projects/packages/my-jetpack/changelog/fix-my-jetpack-global-notice-hook-crash diff --git a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx index 3f1ee120f87f..aa4840b7da5b 100644 --- a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx @@ -56,7 +56,13 @@ export const GlobalNotice = ( { message, title, options } ) => { return (
- + { /* A string `spokenMessage`: by default Root renderToString()s its children mid-render, running their hooks as its own. */ } + { title && { title } } { /* `render={
}`: `message` can carry block content, but Description defaults to a `span`. */ } }> diff --git a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/test/global-notice.test.jsx b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/test/global-notice.test.jsx index 702f5f61c67a..9e03f5b5e7c5 100644 --- a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/test/global-notice.test.jsx +++ b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/test/global-notice.test.jsx @@ -30,6 +30,23 @@ describe( 'GlobalNotice', () => { expect( recordEvent ).toHaveBeenCalledTimes( 1 ); } ); + it( 'keeps rendering when a higher-priority notice with a title replaces an untitled one', () => { + const action = { label: 'Act', onClick: jest.fn() }; + const { rerender } = render( + + ); + + rerender( + + ); + + expect( screen.getByText( 'Missing site connection' ) ).toBeInTheDocument(); + } ); + it( 'hides the close button by default', () => { render( ); diff --git a/projects/packages/my-jetpack/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/packages/my-jetpack/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..1294b7464132 --- /dev/null +++ b/projects/packages/my-jetpack/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix the dashboard crashing with "Something went wrong" when one notice replaces another. From 5e83ff054fad1a7c2d751e9d9c62b085331dba93 Mon Sep 17 00:00:00 2001 From: Xavier Lozano Carreras Date: Fri, 9 Oct 2026 11:39:00 +0200 Subject: [PATCH 2/2] Changelog: My Jetpack notice crash fix for plugins that bundle My Jetpack Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QqfKRQfxuwm723Y1prq8mM --- .../backup/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../boost/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../jetpack/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../protect/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../search/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../social/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../stats/changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ .../changelog/fix-my-jetpack-global-notice-hook-crash | 4 ++++ 8 files changed, 32 insertions(+) create mode 100644 projects/plugins/backup/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/boost/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/jetpack/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/protect/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/search/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/social/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/stats/changelog/fix-my-jetpack-global-notice-hook-crash create mode 100644 projects/plugins/videopress/changelog/fix-my-jetpack-global-notice-hook-crash diff --git a/projects/plugins/backup/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/backup/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/backup/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/boost/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/boost/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/boost/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/jetpack/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/jetpack/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..cd08f5b5f288 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/protect/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/protect/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/protect/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/search/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/search/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/search/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/social/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/social/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/social/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/stats/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/stats/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/stats/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another. diff --git a/projects/plugins/videopress/changelog/fix-my-jetpack-global-notice-hook-crash b/projects/plugins/videopress/changelog/fix-my-jetpack-global-notice-hook-crash new file mode 100644 index 000000000000..dd52c50fcae2 --- /dev/null +++ b/projects/plugins/videopress/changelog/fix-my-jetpack-global-notice-hook-crash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +My Jetpack: Fix the dashboard crashing with "Something went wrong" when one notice replaces another.