Closed ellnix closed 8 months ago
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: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Would be great to get this one merged! This is causing us some issues.
bors merge
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:
MSJob
(although I suspect it would be better if it was replaced with a job dedicated to enqueued indexing, since that's all it does now anyway)ActiveJob
needs to somehow serialize the parameters to a job, default serialization (throughGlobalID
) relies on a database entry to reinitialize the record when the job is runms_entries
methods whose purpose is to use the current configuration to list every index the record may have a document in, along with the record's primary key in that indexUtilities.indexable?
so it is possible that some of the entries it returns are not actually in MeiliSearch, this is by design since its intention is to be exhaustive and in theory those primary keys cannot belong to another record so deleting them should be ok