My Jetpack: suppress backup/scan notifications on multisite#47284
My Jetpack: suppress backup/scan notifications on multisite#47284
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! |
There was a problem hiding this comment.
Pull request overview
This PR suppresses backup failure and scan threat notifications on multisite installations where these products are not supported. The changes prevent unnecessary WPCOM API calls and misleading error banners from appearing on the My Jetpack page in multisite environments.
Changes:
- Added early-return
is_multisite()guards in PHP backend notification methods to prevent API calls for backup/scan alerts - Added frontend
getScriptData().site.is_multisitechecks as a safety net to prevent notices from displaying even if the backend sends alerts - Added changelog entry documenting the fix
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
class-red-bubble-notifications.php |
Added multisite guards to alert_if_last_backup_failed() and alert_if_protect_has_threats() to prevent notification system from querying WPCOM API for unsupported products |
use-backup-needs-attention-notice.tsx |
Added frontend multisite check to prevent backup failure notices from displaying on multisite |
use-protect-threats-detected-notice.tsx |
Added frontend multisite check to prevent scan threat notices from displaying on multisite |
changelog/fix-multisite-backup-scan-notifications |
Documents the bug fix with appropriate significance and type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
See MYJP-222
Proposed changes:
is_multisite()early-return guards toalert_if_last_backup_failed()andalert_if_protect_has_threats()inclass-red-bubble-notifications.php, preventing unnecessary WPCOM API calls and red bubble alerts for products that don't support multisite.use-backup-needs-attention-notice.tsxanduse-protect-threats-detected-notice.tsxso that even if the backend somehow sends a backup/scan alert on multisite, the notice won't display.Context
On multisite, the Backup and Scan product cards are correctly hidden via
JETPACK_PRODUCTS_NOT_FOR_MULTISITE. However, the red bubble notification system still queries the WPCOM API for backup/scan status on multisite. When the backup engine attempts and fails (returningnot-accessiblerather thanmultisite_not_supported), this surfaces as an "Oops! We couldn't back up your site" banner on the My Jetpack page.This is the same class of issue as PROTECT-40, JETH-6378, and JETH-6781. MYJP-222 addressed product card visibility on multisite but didn't cover the notification system.
Other information:
Jetpack product discussion
See MYJP-222. Cross-repo investigation also filed BACKUP-351 for the wpcom-git backup queueing endpoint gap and identified Calypso issues under DOTDEV-312.
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Changelog