meilisearch / meilisearch-rails

Meilisearch integration for Ruby on Rails
https://www.meilisearch.com
MIT License
308 stars 47 forks source link

Fix race condition in queued record & document removal #290

Closed ellnix closed 8 months ago

ellnix commented 1 year ago

Pull Request

Related issue

Fixes #266

What does this PR do?

The purpose of this PR is to detach the MeiliSearch document deletion process from the ActiveRecord object so that documents corresponding to a record can be deleted even if the record no longer exists in the database.

Tests were also added for new functionality and to hopefully prevent regressions.

PR checklist

Please check if your PR fulfills the following requirements:

Solution Considerations

Please read #266 for full context:

codecov[bot] commented 1 year ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (53febb3) 89.15% compared to head (d32db1a) 89.32%.

Files Patch % Lines
lib/meilisearch/rails/ms_clean_up_job.rb 90.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #290 +/- ## ========================================== + Coverage 89.15% 89.32% +0.17% ========================================== Files 10 11 +1 Lines 664 684 +20 ========================================== + Hits 592 611 +19 - Misses 72 73 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jeremylynch commented 9 months ago

Would be great to get this one merged! This is causing us some issues.

brunoocasali commented 8 months ago

bors merge

meili-bors[bot] commented 8 months ago

Build succeeded: