Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
330: Fix settings update regression r=ellnix a=ellnix # Pull Request ## Related issue Fixes #329 May fix #328 ## What does this PR do? - `SafeIndex` before I tried to fix #280 with #301 did not guarantee that its index exists at all, since ``@index`` was created asynchronously it was possible that `SafeIndex#settings` could be called on an index that does not exist. This line: https://github.com/meilisearch/meilisearch-rails/blob/29f59c88881b5a4b5a03d990f11d3aac220cd367/lib/meilisearch-rails.rb#L309 was supposed return an empty hash when asked to fetch the settings of an index that does not exist, however `ApiError#code` is the meilisearch code (`"index_not_found"`) and not the http code (`404`). That line was therefore skipped and the `index_not_found` error was being propagated and caught by the `rescue nil` in: https://github.com/meilisearch/meilisearch-rails/blob/e5ad4d1f10c078097bf211e4d3a6e1d48b24bbc5/lib/meilisearch-rails.rb#L750 until I removed it and tried to replace it with ensuring that `SafeIndex` had an index by making `create_index!` synchronous and all kinds of hell broke loose since now every time an index was used would cause a synchronous wait. Co-authored-by: ellnix <[email protected]>
- Loading branch information