Skip to content

My Jetpack: suppress backup/scan notifications on multisite#47284

Open
kraftbj wants to merge 1 commit intotrunkfrom
backup-multisite-errors
Open

My Jetpack: suppress backup/scan notifications on multisite#47284
kraftbj wants to merge 1 commit intotrunkfrom
backup-multisite-errors

Conversation

@kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Feb 23, 2026

See MYJP-222

Proposed changes:

  • Add is_multisite() early-return guards to alert_if_last_backup_failed() and alert_if_protect_has_threats() in class-red-bubble-notifications.php, preventing unnecessary WPCOM API calls and red bubble alerts for products that don't support multisite.
  • Add frontend safety-net multisite checks in use-backup-needs-attention-notice.tsx and use-protect-threats-detected-notice.tsx so 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 (returning not-accessible rather than multisite_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:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

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:

  • Set up a WordPress multisite installation with Jetpack connected and a Backup paid plan active
  • Visit the My Jetpack page (wp-admin > Jetpack > My Jetpack)
  • Verify that no "Oops! We couldn't back up your site" error notice appears
  • Verify that no Scan/Protect threat detection notice appears
  • Verify that the Backup and Scan product cards remain hidden (existing behavior, unchanged)

Changelog

  • Generate changelog entries for this PR (using AI).

Copilot AI review requested due to automatic review settings February 23, 2026 17:28
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

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), and enable the backup-multisite-errors branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack backup-multisite-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
Copy link
Contributor

github-actions bot commented Feb 23, 2026

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!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Feb 23, 2026
@kraftbj kraftbj added Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Feb 23, 2026
@kraftbj kraftbj requested a review from a team February 23, 2026 17:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_multisite checks 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.

@jp-launch-control
Copy link

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/src/class-red-bubble-notifications.php 21/195 (10.77%) -0.23% 4 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Package] My Jetpack [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants