Commit b0bfab1
Merge #330
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]>2 files changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
| 846 | + | |
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1139 | 1144 | | |
1140 | 1145 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | 1146 | | |
1145 | 1147 | | |
1146 | 1148 | | |
1147 | 1149 | | |
1148 | 1150 | | |
1149 | 1151 | | |
1150 | 1152 | | |
1151 | | - | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | | - | |
1155 | | - | |
1156 | 1155 | | |
1157 | 1156 | | |
1158 | 1157 | | |
| |||
0 commit comments