deleteObjects() exception can prevent nodes to be deleted

Created on 2 December 2020, almost 4 years ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

Steps to reproduce:

  • Make sure you have a working Algolia setup/index in place
  • In case you try to delete an indexed node through UI (node/{nid}/delete form), $this->getAlgoliaIndex()->deleteObjects($ids) will be invoked
  • This can easily fail if your connection to Algolia throws an exception which results in an entity storage exception.

Steps to reproduce

Discuss whether we should catch that exception and allow local node deletion.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @1mly opened merge request.
  • 🇺🇸United States 1mly

    This issue came up for me on a project where we have multiple test environments where we are still connected to the index, but don't want to write to it. Very inconvenient to have to disable the module just to delete content. The fork above fixes it.

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India nikunjkotecha India, Gujarat, Rajkot

    Thanks Milos for reporting the issue and sharing the scenario and Patrick for the MR to fix this.

    Please review the feedback and work on it and I will merge the MR + release a new version.

  • 🇺🇸United States nicxvan

    I'm not sure if this is related, but I cannot delete content after upgrading Algolia:

    Fatal error: Declaration of Algolia\AlgoliaSearch\Http\Psr7\Uri::withScheme(string $scheme): Psr\Http\Message\UriInterface must be compatible with Psr\Http\Message\UriInterface::withScheme($scheme) in /var/www/html/vendor/algolia/algoliasearch-client-php/src/Http/Psr7/Uri.php on line 439

  • 🇺🇸United States nicxvan

    Downgrading algolia search to 3.3.2 fixed my issue

Production build 0.71.5 2024