Backup: add BackupRealtimeMessage component for displaying backup real-time info
Resolves https://github.com/Automattic/jetpack-backup-team/issues/615
Proposed Changes
- Add
BackupRealtimeMessagecomponent for displaying backup real-time info using the new fields introduced in https://github.com/Automattic/wp-calypso/pull/93885. - Add
BackupRealtimeMessageunit tests - Render
BackupRealtimeMessageon latest backup section in the backup page
Why are these changes being made?
For making clear daily vs real-time backups to end users. Project thread: peaFOp-2Iy-p2
Testing Instructions
[!NOTE] It could be tricky to test all scenarios on the UI because you might need to have a site with multiple backups and real-time events, so you can rely on unit tests for this PR. You can run unit tests locally by running:
yarn run test-client client/components/jetpack/daily-backup-status/test/backup-realtime-message.jsx
- Spin up a Jetpack Cloud live branch
- Pick a site with Jetpack VaultPress Backup with some backups and real-time events
- Navigate to the Backup page
- Search for a date where your last backup is a real-time event. If you can't find any, you could try doing some actions on your site like publishing/updating a post or uploading images.
- If your last backup is a real-time event, you should see a message like this:
- If it is not a real-time event, you should not see the message:
Pre-merge Checklist
- [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
- [ ] Have you written new tests for your changes?
- [ ] Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
- [ ] Have you checked for TypeScript, React or other console errors?
- [ ] Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
- [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
- [ ] For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?
Jetpack Cloud live (direct link)
|
|
https://calypso.live?image=registry.a8c.com/calypso/app:build-118457&env=jetpack |
Automattic for Agencies live (direct link)
|
|
https://calypso.live?image=registry.a8c.com/calypso/app:build-118457&env=a8c-for-agencies |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:
Sections (~440 bytes added 📈 [gzipped])
name parsed_size gzip_size
jetpack-cloud-agency-sites-v2 +1991 B (+0.1%) +440 B (+0.1%)
backup +1991 B (+0.2%) +440 B (+0.1%)
a8c-for-agencies-sites +1991 B (+0.1%) +440 B (+0.1%)
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.
Legend
What is parsed and gzip size?
Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.
Generated by performance advisor bot at iscalypsofastyet.com.
As an example, I selected August 16, where there is a full backup for that day, and the last backup is a real-time backup
In this screenshot, the base backup for that real-time is for the same day (2024-08-16 11:44 AM), but it says 11-day old full backup because it is compared with today (August 27)
In this screenshot, the base backup for that real-time is for the same day (
2024-08-16 11:44 AM), but it says11-day old full backupbecause it is compared with today (August 27)
@mavegaf Thanks for clarifying!
It means that the we are using the full backup from today/yesterday will never apply, or will not be very consistent.
I will suggest rephrasing them like:
- Scenario 1 - The base backup is from the same date as the selected backup
- Before:
We are using the full backup from today(...) - After:
We are using a full backup from this day(...)
- Before:
- Scenario 2 - The base backup is from the day before as the selected backup
- Before:
We are using the full backup from yesterday(...) - After:
We are using a full backup from the previous day(...)
- Before:
- Scenario 3 - The base backup is from 2 or more days before as the selected backup
- (it remains the same):
We are using a #-day old full backup(...)
- (it remains the same):
Note that I'm also replacing the with a.
Any thoughts?
In this screenshot, the base backup for that real-time is for the same day (
2024-08-16 11:44 AM), but it says11-day old full backupbecause it is compared with today (August 27)@mavegaf Thanks for clarifying! It means that the
we are using the full backup from today/yesterdaywill never apply, or will not be very consistent.I will suggest rephrasing them like:
Scenario 1 - The base backup is from the same date as the selected backup
- Before:
We are using the full backup from today(...)- After:
We are using a full backup from this day(...)Scenario 2 - The base backup is from the day before as the selected backup
- Before:
We are using the full backup from yesterday(...)- After:
We are using a full backup from the previous day(...)Scenario 3 - The base backup is from 2 or more days before as the selected backup
- (it remains the same):
We are using a #-day old full backup(...)Note that I'm also replacing
thewitha.Any thoughts?
Yes, today/yesterday was a message only when the backup selected was the last one. I like the proposal, it's clear and simpler to implement 👍
@mavegaf Great, thanks for your feedback! I just made the changes based on that. This is ready for a re-review :)
Also added the instructions to run the unit tests on the PR description:
yarn run test-client client/components/jetpack/daily-backup-status/test/backup-realtime-message.jsx
@Initsogar With this PR I found that other cases need to be handled in the endpoint, so I've left it in Blocked/Hold until the changes in the API are ready
This PR modifies the release build for the following Calypso Apps:
For info about this notification, see here: PCYsg-OT6-p2
- notifications
- wpcom-block-editor
To test WordPress.com changes, run install-plugin.sh $pluginSlug update/backup-realtime-changes on your sandbox.
Since we are still polishing the API to fetch the right base_rewind_id and rewind_step_count, I just added a feature flag (jetpack/backup-realtime-message) for rendering the realtime message, so we could safely merge this PR and continue working on https://github.com/Automattic/wp-calypso/pull/94218 which has this one as dependency.
@mavegaf could you take another look?
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/16647738
Thank you @Initsogar for including a screenshot in the description! This is really helpful for our translators.
Translation for this Pull Request has now been finished.