Skip to content
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

Fix ActiveJob::DeserializationError issue #369

Closed
wants to merge 14 commits into from

Conversation

zhukovpe
Copy link

@zhukovpe zhukovpe commented Oct 17, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? yes
Related Issue Fix #359
Need Doc update no

Describe your change

Change job arguments to receive a record identifier and a model class name (for index info) as a parameter instead of a model instance. Add a method to remove a record from algolia index by id.

What problem is this fixing?

Asynchronous index update enqueues a job with the specific object instance as a parameter. This specific object cannot be deserialised from the parameter during job processing for the deleted record. An asynchronous index update job for the deleted record will always fail.

Breaking changes

Previously deployed AlgoliaJob will fail if executed with the new version

@annikoff
Copy link
Contributor

I suppose it has some breaking changes because if you have enqueued some AlgoliaJob jobs they will fail after version update.

@lukad03
Copy link

lukad03 commented Feb 3, 2020

Any timeline for review of this?

@marckohlbrugge
Copy link

Could this (or a similar fix) please be merged?

Right now the gem is basically broken when it comes to removing records from the index.

@chloelbn
Copy link
Contributor

Hi @marckohlbrugge , @lukad03 and @zhukovpe !
As we can't introduce BC break in fixes, this PR can't be merged as-is. It also introduces a lot of refactoring which, even if it's a really good idea considering the code base, is not the scope of this.
To be able to provide a solution for this problem, a new PR has to be made to fix the issue and only the issue, in a backward-compatible way. The ressources are a bit limited right now and we can't provide an ETA to resolve the issue on our side. However, if you wish to quicken this fix, you can provide a new PR anytime and we'll review it asap.

Thanks for your understanding!

@duhaime
Copy link

duhaime commented Feb 3, 2023

@chloelbn does this library have a pattern to remove objects from an algolia index after the record has been deleted from the db?

Specifically, is there a good way to get the object id of a record in a particular index after that record has been deleted from the db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AlgoliaJob for the deleted record always rise ActiveJob::DeserializationError
6 participants