You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Asynchronous index update enqueues a job with the specific object instance as a parameter. This specific object cannot be deserialized from the parameter during job processing for the deleted record. An asynchronous index update job for the deleted record will always fail.
A possible solution according to job guidelines could be to enqueue a job with the record identifier as a parameter, not the instance itself. Decouple index update logic from the model and use this logic inside job. We need only an ID to delete a record from the index, not the object itself.
Steps To Reproduce
Create a simple model with the Algolia included and configured to update the index asynchronously
class School
include Mongoid::Document
include AlgoliaSearch
field :title, type: String
field :description, type: String
field :street, type: String
field :zipcode, type: String
field :city, type: String
algoliasearch per_environment: true, enqueue: true do
attributes :title, :street, :zipcode, :city
end
end
Description
Asynchronous index update enqueues a job with the specific object instance as a parameter. This specific object cannot be deserialized from the parameter during job processing for the deleted record. An asynchronous index update job for the deleted record will always fail.
A possible solution according to job guidelines could be to enqueue a job with the record identifier as a parameter, not the instance itself. Decouple index update logic from the model and use this logic inside job. We need only an ID to delete a record from the index, not the object itself.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: