meilisearch / meilisearch-ruby

Ruby SDK for the Meilisearch API
https://meilisearch.com
MIT License
198 stars 43 forks source link

Entire index is deleted if you pass nil to delete_document #556

Closed jeremylynch closed 2 weeks ago

jeremylynch commented 1 month ago

There is a serious bug which occurs when you pass nil to delete_document which causes the entire index to be cleared.

Book.index.delete_document(nil)

Instead, I think it would be safer to return an error when nil is passed to avoid this catastrophic outcome.

curquiza commented 1 month ago

Thank you for the the report @jeremylynch

Any PR are welcome (from anyone)