-
Notifications
You must be signed in to change notification settings - Fork 33
Remove useless serialize on remove #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #385 +/- ##
============================================
- Coverage 88.41% 88.37% -0.04%
Complexity 1 1
============================================
Files 20 20
Lines 889 886 -3
============================================
- Hits 786 783 -3
Misses 103 103 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
About the test which was not passing : $result = $this->engine->remove($searchableImage);
$this->assertEmpty($result); I think the test was wrong, the engine should not assume an entity should not be removed, as it don't know anything about previous actions on this entity. |
What is the real output of |
something like that : array:1 [
"sf_phpunit__image" => array:1 [
0 => array:5 [
"taskUid" => 1812
"indexUid" => "sf_phpunit__image"
"status" => "enqueued"
"type" => "documentDeletion"
"enqueuedAt" => "2025-06-06T09:25:04.919874074Z"
]
]
] |
Yes, the test then was totally wrong. Also I think current implementation is not optimal because it schedules to delete documents one by one.. There is a batch endpoint for this, but i'll open another issue about this. Btw if you'd remove this code above:
Does the test still pass? I think this is not needed, because there is doctrine listener which does the indexing, and the test flushes the entity to database, so not sure why it's done like this |
Without the previous indexing test yes, still passing. About optimality, yes, there is also there where there is a foreach with a db query, instead of using an array in only one query, that's why we currently use a rawSearch insead of search, but as you say it's another subject.
but maybe it's less generic. |
About that part you gave - it's more complex problem, and i am in long long progress of refactoring that. So then remove that |
Yes that what I thought about "multiple fields ids", etc. |
Thank you @johndodev |
Pull Request
Related issue
This is a first step to fix #379
What does this PR do?
This PR remove the serializing of "about to be removed from index" entities.
Indeed, when an entity should be removed because of a change (an update of the entity, not a remove) which make it not indexable anymore, the entity was serialized. This is problem because
PR checklist
Please check if your PR fulfills the following requirements: