Skip to content

Connection: Remove includeHealthErrors prop and usage - #52977

Merged
coder-karen merged 2 commits into
trunkfrom
remove/connection-include-health-errors
Oct 2, 2026
Merged

coder-karen merged 2 commits into
trunkfrom
remove/connection-include-health-errors

Conversation

@coder-karen

@coder-karen coder-karen commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes CONNECT-463

Proposed changes

  • Connection: Consume the health check endpoint and show results via the existing error UI - Activity Log initially #50169 added includeHealthErrors so a consumer could show connection health-check failures in the shared connection error notice. Activity Log was the only consumer: it ran the health check when its list request failed. Connection error notices now cover the most important non-token problems directly, through stored xmlrpc_request_blocked and wpcom_ssl_verification_failed errors. The separate client-side health-check path is no longer needed, so this PR removes it.
  • This PR removes the changes added in the mentioned PR. However we keep runConnectionHealthCheck as a deprecated no-op that resolves with {}. Activity Log bundles its own copy of the connection package, and the connection store is registered by whichever script runs first on the page. An older Activity Log build can therefore run against this newer store, and it calls the thunk without a guard. The stub prevents a crash in that case and can be removed in a later release.

What this means for the Activity Log:

  • In practice, Activity Log's connection notice now only shows when a stored connection error coincides with a failed list request. Stored errors that don't affect the list's outgoing, user-token-signed request (such as xmlrpc_request_blocked and wpcom_ssl_verification_failed) won't appear there, which fits the notice's "Your activity log couldn't load because…" context. My Jetpack remains the place for site-wide connection state. The <ConnectionError> branch is kept so Activity Log picks up token rejections automatically if they're stored as connection errors in future.

Related product discussion/links

  • See above Linear link.

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

No.

Testing instructions

On a Jetpack-connected site running this branch, with Jetpack Debug Tools active (it can be enabled from the Jetpack Beta Tester plugin list):

Activity Log, healthy connection

  • Visit /wp-admin/admin.php?page=jetpack-activity-log with DevTools open on the Network tab.
  • The list loads normally, and no request is made to /jetpack/v4/connection/test.

Activity Log, broken user token (no stored connection error)

  • Under Jetpack Debug › Broken token utilities, choose "Set invalid user token (current user)". The Connection errors view in the debug tool stays empty.
  • Reload Activity Log. The connection error notice does not show, and neither does the My Jetpack notice. Activity Log shows its own "Couldn't load the activity log: …" notice with the WordPress.com error, as on trunk before Connection: Consume the health check endpoint and show results via the existing error UI - Activity Log initially #50169. There is no /connection/test request.
    • Note that this itself can be confusing (eg 'Only Administrators can query information about the current site' when an admin token is broken) but is unrelated to connection errors here.
  • Reset the token in Broken token utilities (or disconnect and reconnect your user). Activity Log loads normally again.

Activity Log, broken site token

  • Using the Jetpack debug helper plugin, create a site error on the connection errors page.
  • The Activity Log page should continue to show logs and no connection error notices, as the log does not require a site connection

Activity Log, broken blog and user tokens (stored connection error and list failure)

  • In Broken token utilities, choose Set invalid blog token, then Set invalid user token (current user).
  • Load Activity Log. The list fails; the request's blog-token check stores an invalid_token) error.
  • Reload Activity Log. The shared connection error notice shows with the "Your activity log couldn't load because your site isn't fully connected to WordPress.com." context line.

Activity Log, list failure with no connection error

Other consumers unaffected

  • The connection error notice still shows in My Jetpack and Activity Log when a stored connection error exists. For example, use Broken token utilities to generate a sample verified error, then reload both pages. Activity Log shows it only when its list request also fails.

Deprecated stub

  • On the Activity Log page, run await wp.data.dispatch( 'jetpack-connection' ).runConnectionHealthCheck() in the console. It resolves with {} and makes no network request.
  • wp.data.select( 'jetpack-connection' ).getConnectionHealthErrors is undefined.

@github-actions

github-actions Bot commented Sep 30, 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 or WordPress.com Site Helper), and enable the remove/connection-include-health-errors branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack remove/connection-include-health-errors
bin/jetpack-downloader test jetpack-mu-wpcom-plugin remove/connection-include-health-errors

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 [Package] Connection [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/ [Tests] Includes Tests Docs RNA labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 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:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

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.


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.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 5 files.

File Coverage Δ% Δ Uncovered
projects/js-packages/connection/components/use-connection/index.ts 26/30 (86.67%) -0.43% 0 💚
projects/js-packages/connection/hooks/use-connection-error-notice/index.tsx 39/40 (97.50%) -0.12% 0 💚
projects/js-packages/connection/state/actions.jsx 50/63 (79.37%) -3.07% 0 💚
projects/js-packages/connection/state/selectors.jsx 13/20 (65.00%) -1.67% 0 💚
projects/js-packages/connection/state/reducers.jsx 37/48 (77.08%) 0.16% -1 💚

Full summary · PHP report · JS report

@coder-karen
coder-karen requested a balanced review from Copilot September 30, 2026 12:09
@coder-karen
coder-karen marked this pull request as ready for review September 30, 2026 12:10
@coder-karen
coder-karen requested a review from a team as a code owner September 30, 2026 12:10
@coder-karen
coder-karen removed the request for review from a team September 30, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

User-facing changelog entries are missing for Search, VideoPress, and Protect.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Removes Activity Log’s client-side connection health check, relying on stored connection errors while retaining a deprecated no-op for compatibility.

Changes:

  • Removes health-check state, mapping, selectors, props, and dependency.
  • Simplifies Activity Log error-notice selection.
  • Updates tests, documentation, and changelogs.
File Description
projects/​plugins/​jetpack/​changelog/​remove-connection-include-health-errors Adds Jetpack changelog entry.
projects/​plugins/​boost/​changelog/​remove-connection-include-health-errors Adds Boost changelog entry.
projects/​plugins/​backup/​changelog/​remove-connection-include-health-errors Adds Backup changelog entry.
projects/​packages/​connection/​docs/​error-handling.md Removes health-error documentation.
projects/​packages/​connection/​changelog/​remove-connection-include-health-errors Records documentation update.
projects/​packages/​activity-log/​src/​js/​components/​ActivityLog/​index.tsx Removes health-check request and state.
projects/​packages/​activity-log/​changelog/​remove-connection-include-health-errors Documents changed notice behavior.
projects/​js-packages/​connection/​state/​test/​run-connection-health-check.jsx Tests deprecated no-op behavior.
projects/​js-packages/​connection/​state/​selectors.jsx Removes health-error selector.
projects/​js-packages/​connection/​state/​reducers.jsx Removes health-error state.
projects/​js-packages/​connection/​state/​actions.jsx Replaces health check with compatibility stub.
projects/​js-packages/​connection/​package.json Removes unused API-fetch dependency.
projects/​js-packages/​connection/​hooks/​use-connection-error-notice/​types.ts Removes public opt-in prop.
projects/​js-packages/​connection/​hooks/​use-connection-error-notice/​test/​memoization.test.tsx Updates hook mock data.
projects/​js-packages/​connection/​hooks/​use-connection-error-notice/​test/​detection.test.ts Removes health-error cases.
projects/​js-packages/​connection/​hooks/​use-connection-error-notice/​index.tsx Uses only stored connection errors.
projects/​js-packages/​connection/​helpers/​test/​map-health-check-errors.jsx Deletes obsolete mapper tests.
projects/​js-packages/​connection/​helpers/​map-health-check-errors.ts Deletes obsolete mapper.
projects/​js-packages/​connection/​components/​use-connection/​types.ts Removes health-error return field.
projects/​js-packages/​connection/​components/​use-connection/​index.ts Stops selecting health errors.
projects/​js-packages/​connection/​changelog/​remove-connection-include-health-errors Records removed public API.
pnpm-lock.yaml Removes API-fetch lock entry.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added [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] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. labels Sep 30, 2026
@coder-karen coder-karen added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Sep 30, 2026
@coder-karen
coder-karen force-pushed the remove/connection-include-health-errors branch from 4588aa3 to a36d526 Compare October 1, 2026 09:59

@fgiannar fgiannar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work here, Karen! Looks and tests well :shipit:

@fgiannar fgiannar added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Oct 2, 2026
@coder-karen
coder-karen force-pushed the remove/connection-include-health-errors branch from a36d526 to d5b2194 Compare October 2, 2026 11:15
@coder-karen
coder-karen merged commit fdbdc00 into trunk Oct 2, 2026
119 checks passed
@coder-karen
coder-karen deleted the remove/connection-include-health-errors branch October 2, 2026 11:44
@github-actions github-actions Bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs [JS Package] Connection [Package] Activity Log [Package] Connection [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] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. RNA [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants