Skip to content

Conversation

@dereksmart
Copy link
Contributor

Fixes the missing Backups card in the main dashboard when waiting for the response of the /rewind endpoint, as well as when that endpoint returns an error.

Changes proposed in this Pull Request:

The way this card works is quite confusing, since it needs to handle both VaultPress and Rewind statuses.

Currently, this card relies on the /rewind endpoint to return one of a specific key before displaying any information. Unfortunately, there is no case for when the API errors. In this case, the value of this.props.rewindStatus is empty, therefore not falling back to the getVPContent() content that is used to show the loading/upgrade prompts.

IMO this entire component could use a re-write. But for an immediate fix, this should at least solve the problem of the missing card in any case.

Before:
image

After:
image
image

Jetpack product discussion

N/A

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

No

Testing instructions:

  • Connect Jetpack
  • Use the "Broken Token" plugin to "Set Invalid User Tokens". This will trigger an error in the /rewind API endpoint.
  • Navigate to /dashboard
  • With this patch, the card should show both the loading state, and the final state based on the rewind response.

Test it also on a paid plan to make sure the correct information shows, based on whether the site has VP or Rewind enabled.

Proposed changelog entry for your changes:

(Optional) General: Fix missing dashboard card for Backups in some error cases.

@dereksmart dereksmart added [Type] Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. Admin Page React-powered dashboard under the Jetpack menu labels Aug 17, 2020
@dereksmart dereksmart added this to the 8.9 milestone Aug 17, 2020
@dereksmart dereksmart self-assigned this Aug 17, 2020
@jetpackbot
Copy link
Collaborator

jetpackbot commented Aug 17, 2020

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16867

Scheduled Jetpack release: September 1, 2020.
Scheduled code freeze: August 25, 2020

Generated by 🚫 dangerJS against b0a7138

@dereksmart dereksmart force-pushed the fix/empty-aag-backups-card-on-rewind-error branch from 4e4cb77 to 005da6a Compare August 17, 2020 20:33
@dereksmart dereksmart force-pushed the fix/empty-aag-backups-card-on-rewind-error branch from 005da6a to b0a7138 Compare August 17, 2020 22:51
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Aug 18, 2020
@dereksmart dereksmart merged commit fad81a1 into master Aug 19, 2020
@dereksmart dereksmart deleted the fix/empty-aag-backups-card-on-rewind-error branch August 19, 2020 13:27
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Aug 19, 2020
davidlonjon added a commit that referenced this pull request Aug 20, 2020
* master: (23 commits)
  Premium Blocks: set blocks availability (#16898)
  Compat Package: Fix method declaration compatibility (#16900)
  Jetpack Dashboard: More meaningful error notices. (#16883)
  Connection REST API: Unit test for the `remote_authorize` request. (#16879)
  use blog token to request jetpack.updateBlog (#16698)
  Improve Story block media loading (#16663)
  Simplify error notices for broken connections (#16655)
  Use new heartbeat package (#16285)
  wrap-paid-block: remove component. deprecated. (#16895)
  Social Previews: improve preview description handling (#16889)
  Stats module use blog token (#16727)
  Form Block: add a new Consent Field, a new Newsletter setting, and a new newsletter variation (#16808)
  AAG: Backup card, fall back to VP content in case of /rewind API error. (#16867)
  Donations: Fix dependencies (#16892)
  Creative Mail: update option to lowercase (#16861)
  Premium Blocks: Implement the new design (#16611)
  Requests to Stats CSV use the blog token (#16716)
  Update spacing around sharing buttons to avoid no bottom margin below the customize link. (#16811)
  Jetpack SSO: Cleaning up the `requestNonce` API request. (#16830)
  Donations: Update plans when currency changes (#16844)
  ...
jeherve added a commit that referenced this pull request Aug 25, 2020
pereirinha pushed a commit that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu [Feature] Backups [Type] Bug When a feature is broken and / or not performing as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants