Skip to content

Post being deleted in Algolia when updated #489

@simpledeploy

Description

@simpledeploy

Describe the bug
We have had problems with posts being deleted from Algolia indexes on update, both when the editors updates post via WP Admin and also by using $algolia->get_index('posts_poi')->sync($post) which we are using for batch updating of posts.

We disabled the async update to avoid race conditions by this filter: add_filter('algolia_should_wait_on_delete_item', '__return_true');

It seems to have improved, but we are still occasionally see this issues. When inspecting the Algolia API log for those instances, we can see that the time stamp for both delete and update are identically.

What can we expect from the algolia_should_wait_on_delete_item filter.

To Reproduce
Steps to reproduce the behavior:

  1. Enabled the the filter add_filter('algolia_should_wait_on_delete_item', '__return_true');
  2. Make updates to posts
  3. Inspect the Algolia API Log and occasionally you will see that update and delete requests have the same timestamp, sometimes this leads to race conditions and the post is deleted from Algolia.

Expected behavior
No race conditions and deletions of posts in Algolia with the algolia_should_wait_on_delete_item filter enabled.

Screenshots

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    indexingIssues around the indexing process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions