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

Show a message when an indexing is stopped by the WP-CLI command #2549

Merged
merged 8 commits into from
Feb 3, 2022

Conversation

Rahmon
Copy link
Contributor

@Rahmon Rahmon commented Jan 11, 2022

Description of the Change

This PR updates the Sync Page to show a message when an indexing is stopped by the WP-CLI command (wp elasticpress stop-indexing)

Alternate Designs

Benefits

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#2489

Changelog Entry

Copy link
Member

@felipeelia felipeelia left a comment

Choose a reason for hiding this comment

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

@Rahmon I tried this one following these steps:

  1. Started a new "full" sync in the dashboard (per page = 2 so it goes slowly)
  2. Called wp elasticpress stop-indexing in the terminal

This is what happened:

  1. I saw a Sync interrupted by WP-CLI command in the log (expected) but if I don't have the log opened I can't know what is happening, as Sync in progress is still visible.
  2. The buttons didn't change, so I can still see "Pause" (but it's already "paused") and "Stop". We probably should trigger the "Stop" behavior, so people can't simply resume it from the dashboard again.
  3. If I click on "Pause" the button becomes "Resume" and I see "Sync paused" in the logs. Then if I click on "Resume", it will start over.

@felipeelia felipeelia assigned Rahmon and unassigned felipeelia Jan 12, 2022
@Rahmon Rahmon assigned felipeelia and unassigned Rahmon Jan 14, 2022
@Rahmon
Copy link
Contributor Author

Rahmon commented Jan 14, 2022

@felipeelia when you have a chance, could you review it again?

@felipeelia
Copy link
Member

@Rahmon , I really think the sync should trigger the exact same behavior of a stop. Right now, if someone stops the sync, it'll just "freeze" things, leaving the dashboard user no action. Let's bring that decision to the weekly sync.
Some other issues I'm seeing:

  1. If I stop the sync after it started, the progress bar will go to 0%
  2. If I pause it in the dashboard and stop it in the terminal, nothing happens in the dashboard. Then, if I click on resume, things will happen like step # 1

@Rahmon
Copy link
Contributor Author

Rahmon commented Jan 17, 2022

@felipeelia just to be sure, did you run npm run build before reviewing it?

@felipeelia
Copy link
Member

@felipeelia just to be sure, did you run npm run build before reviewing it?

yup!

@brandwaffle
Copy link
Contributor

"Your indexing process has been stopped by WP-CLI and your (ElasticPress.io||Elasticsearch) index could be missing content. To restart indexing, please click the Start button or use WP-CLI commands to perform the reindex. Please note that search results could be incorrect or incomplete until the reindex finishes."

@Rahmon Rahmon assigned felipeelia and unassigned Rahmon Jan 19, 2022
@felipeelia felipeelia merged commit 60ef4bb into 4.x.x Feb 3, 2022
@felipeelia felipeelia deleted the chore/add-message-to-ouput-wp-cli-issue-2489 branch February 3, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants