Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Sync page shows a successful previous sync even if the index has been deleted #2962

Closed
JakePT opened this issue Aug 24, 2022 · 1 comment · Fixed by #3011
Closed

BUG: Sync page shows a successful previous sync even if the index has been deleted #2962

JakePT opened this issue Aug 24, 2022 · 1 comment · Fixed by #3011
Assignees
Labels
bug Something isn't working module:sync Issues related to the Sync functionality
Milestone

Comments

@JakePT
Copy link
Contributor

JakePT commented Aug 24, 2022

Describe the bug
The status of the ElasticPress Sync page is currently based on the results of the last sync operation. If a sync has not been performed yet the sync page will only offer a single option for syncing (#2858) and a "You just need to sync your content" admin notice will appear. If a sync has been performed the sync page will show the status of the last sync and display an additional option to delete and sync.

The problem is that if an index is deleted, such as by running the wp elasticpress delete-index WP CLI command, the status of the sync page is still based on the last sync operation. This could result in a situation where an index no longer exists but the Sync page appears to show that things have been synced successfully and the admin notice instructing the user to sync their content will not appear.

Steps to Reproduce

  1. Install and set up ElasticPress then index your content
  2. In WP-CLI run wp elasticpress delete-index
  3. Visit the Sync page.

Expected behavior
Ideally the sync page and admin notice should reflect whether or not an index exists, and if one does not exist they should behave as if a previous sync has not been performed.

I'm not sure whether the correct resolution would be to delete data about the last sync when the index is deleted, or to expand the logic of the sync page and admin notice to also check for the existence of the index. The former would be simpler but there may be reasons to keep the last sync data after deleting the index.

@JakePT JakePT added the bug Something isn't working label Aug 24, 2022
@JakePT JakePT added this to the 4.4.0 milestone Aug 24, 2022
@felipeelia
Copy link
Member

Let's check indices in Elasticsearch directly, comparing with the indices list we would expect to see based on enabled features.

@MARQAS MARQAS assigned felipeelia and unassigned MARQAS Sep 20, 2022
@felipeelia felipeelia added the module:sync Issues related to the Sync functionality label Sep 30, 2022
@felipeelia felipeelia assigned MARQAS and unassigned felipeelia Oct 11, 2022
@MARQAS MARQAS assigned felipeelia and unassigned MARQAS Nov 1, 2022
@felipeelia felipeelia assigned MARQAS and unassigned felipeelia Nov 1, 2022
@MARQAS MARQAS assigned felipeelia and unassigned MARQAS Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:sync Issues related to the Sync functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants