Connection: Remove includeHealthErrors prop and usage - #52977
Conversation
|
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: The Jetpack plugin has different release cadences depending on the platform:
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. |
Code Coverage SummaryCoverage changed in 5 files.
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
User-facing changelog entries are missing for Search, VideoPress, and Protect.
Review effort: Balanced
Findings: 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.
4588aa3 to
a36d526
Compare
fgiannar
left a comment
There was a problem hiding this comment.
Great work here, Karen! Looks and tests well ![]()
a36d526 to
d5b2194
Compare

Fixes CONNECT-463
Proposed changes
includeHealthErrorsso 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 storedxmlrpc_request_blockedandwpcom_ssl_verification_failederrors. The separate client-side health-check path is no longer needed, so this PR removes it.runConnectionHealthCheckas 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:
xmlrpc_request_blockedandwpcom_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
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
/wp-admin/admin.php?page=jetpack-activity-logwith DevTools open on the Network tab./jetpack/v4/connection/test.Activity Log, broken user token (no stored connection error)
/connection/testrequest.Activity Log, broken site token
Activity Log, broken blog and user tokens (stored connection error and list failure)
invalid_token) error.Activity Log, list failure with no connection error
Other consumers unaffected
Deprecated stub
await wp.data.dispatch( 'jetpack-connection' ).runConnectionHealthCheck()in the console. It resolves with{}and makes no network request.wp.data.select( 'jetpack-connection' ).getConnectionHealthErrorsisundefined.