Serchable, sortable and filterable attributes change check incorrect

Created on 13 September 2023, over 1 year ago
Updated 21 September 2023, about 1 year ago

Problem/Motivation

For the attributes mentioned in the title, there is a check if the search API config is different than Meilisearch settings. The generated attributes by the backend code are not necessarily in the same order as Meilisearch returns them. This potentially causes all settings to always update.

Steps to reproduce

  1. Install and configure the module.
  2. Prepare an index with some fields.
  3. Open the module code, with some kind of debugger.
  4. Place breakpoints after the comparisons.
  5. Go to the Search API field settings, without changing anything, just click "Save Changes".
  6. Your code execution has a big change to stop at one or all of the breakpoints.

Proposed resolution

Since the order of these values is not important, using sort before or in the if statement should do the job.

Remaining tasks

Fix the code

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024