Closed ellnix closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
29f59c8
) 89.32% compared to head (03a8daa
) 89.47%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
bors merge
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 thatSafeIndex#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, howeverApiError#code
is the meilisearch code ("index_not_found"
) and not the http code (404
). That line was therefore skipped and theindex_not_found
error was being propagated and caught by therescue 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 thatSafeIndex
had an index by makingcreate_index!
synchronous and all kinds of hell broke loose since now every time an index was used would cause a synchronous wait.