Skip to content

Conversation

@Initsogar
Copy link
Contributor

@Initsogar Initsogar commented Dec 13, 2025

Fixes BACKUP-298

When backups are intentionally deactivated (status: backups-deactivated), My Jetpack shows "The last backup attempt failed" which is confusing because the backup isn't failing - it's just turned off.

Proposed changes:

  • Use contextual error title from useGetReadableFailedBackupReason() hook instead of hardcoded "The last backup attempt failed"
  • Show contextual tooltip and description messages based on backup status
    • For deactivated backups: "Please contact support to reactivate backups for your site"
    • For other errors: "Check out our troubleshooting guide"
Before After
CleanShot 2025-12-15 at 22 47 48@2x CleanShot 2025-12-15 at 23 57 07@2x

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

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

Testing instructions:

  • Add this to tools/docker/mu-plugins/0-snippets.php:
add_filter( 'pre_http_request', function( $preempt, $args, $url ) {
	// Mock /rewind endpoint - backups deactivated scenario
	if ( false !== strpos( $url, '/rewind?force=wpcom' ) && false === strpos( $url, '/rewind/backups' ) ) {
		return array(
			'response' => array( 'code' => 200 ),
			'body'     => wp_json_encode( array(
				'state'        => 'active',
				'last_updated' => '2025-12-13T04:52:18.461+00:00',
				'credentials'  => null,
				'rewind'       => null,
				'alerts'       => array(
					'threats' => array(),
				),
				'downloads'    => array(),
				'has_cloud'    => true,
			)),
		);
	}

	// Mock /rewind/backups endpoint - backups deactivated status
	if ( false !== strpos( $url, '/rewind/backups' ) ) {
		return array(
			'response' => array( 'code' => 200 ),
			'body'     => wp_json_encode( array(
				array(
					'id'           => '803919785',
					'started'      => '2025-12-12 22:51:16',
					'last_updated' => '2025-12-12 22:51:16',
					'status'       => 'backups-deactivated',
					'period'       => '1765579871',
					'percent'      => '0',
					'is_backup'    => '1',
					'is_scan'      => '1',
				),
				array(
					'id'           => '803505601',
					'started'      => '2025-12-12 00:24:26',
					'last_updated' => '2025-12-12 00:24:26',
					'status'       => 'backups-deactivated',
					'period'       => '1765499048',
					'percent'      => '0',
					'is_backup'    => '1',
					'is_scan'      => '1',
				),
				array(
					'id'           => '803051084',
					'started'      => '2025-12-10 23:45:27',
					'last_updated' => '2025-12-10 23:45:27',
					'status'       => 'backups-deactivated',
					'period'       => '1765410322',
					'percent'      => '0',
					'is_backup'    => '1',
					'is_scan'      => '1',
				),
			)),
		);
	}

	return $preempt;
}, 10, 3 );
  • Clear transient: jetpack docker exec wp transient delete 'my-jetpack-backup-status'
  • Navigate to My Jetpack at /wp-admin/admin.php?page=my-jetpack
  • Verify the backup card shows an error state
  • Check error title: Should say "Backup is deactivated" (not "The last backup attempt failed")
  • Check tooltip text: Hover over info icon - should say "Please contact support to reactivate backups for your site"
  • Check error description: Should say "Please contact support to reactivate backups for your site" (not generic troubleshooting text)

@Initsogar Initsogar self-assigned this Dec 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 13, 2025

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 fix/my-jetpack-backups-deactivated-card branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/my-jetpack-backups-deactivated-card

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 Dec 13, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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 Dec 13, 2025
@jp-launch-control
Copy link

jp-launch-control bot commented Dec 13, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx 0/49 (0.00%) 0.00% 3 ❤️‍🩹

Full summary · PHP report · JS report

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

Labels

[Package] My Jetpack [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants