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

Display sync history #3664

Merged
merged 7 commits into from
Oct 4, 2023
Merged

Display sync history #3664

merged 7 commits into from
Oct 4, 2023

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Sep 28, 2023

Description of the Change

Displays the sync history on the sync page. Currently limited to Completed syncs (with errors or not).

elasticpress test_wp-admin_admin php_page=elasticpress-sync

How to test the Change

  • Visit ElasticPress > Sync. A Sync history panel should be visible with at least one previous sync (if coming from < 5.0.0).
  • When a new sync is completed it should be added to the list automatically without a refresh.
  • If a a sync is triggered via WP CLI that should be reflected in the the sync title.
  • The history should not appear for the initial sync on a site, or after deleting an index.
  • The Delete and sync... and Advanced options panels should only be visible if there is a sync history.

Changelog Entry

Added - Added a sync history to the Sync page.

Credits

Props @JakePT @felipeelia @brandwaffle @anjulahettige Apurv Ray

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@JakePT JakePT closed this Sep 28, 2023
@JakePT JakePT reopened this Sep 28, 2023
@JakePT JakePT changed the base branch from develop to 5.0.0 September 28, 2023 18:02
@JakePT JakePT added this to the 5.0.0 milestone Sep 28, 2023
@felipeelia
Copy link
Member

@JakePT I gave this a try and it seems we are not capturing if a sync failed or not. Adding this snippet to a mu-plugin makes the [illegal_argument_exception] Limit of total fields [5000] in index [elasticpresstest-post-1] has been exceeded error to happen:

add_filter(
	'ep_prepare_meta_data',
	function( $post_meta, $post ) {
		for ( $i = 0; $i < 100; $i++ ) {
			$post_meta[ "test_meta_{$i}_title_{$post->ID}" ] = 'Lorem';
			$post_meta[ "test_meta_{$i}_body_{$post->ID}" ]  = 'Ipsum';
		}
		return $post_meta;
	},
	10,
	2
);

I can see the errors in the log. If I wait for it to complete and reload the page I can see the new entry but it says it was successful.

@felipeelia
Copy link
Member

@JakePT we talked about this and it is enough to say it was triggered due to a setting change, we do not need to specify the change for now.

@felipeelia felipeelia merged commit a54ae19 into 5.0.0 Oct 4, 2023
9 checks passed
@felipeelia felipeelia deleted the feature/sync-history branch October 4, 2023 15:59
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.

2 participants