-
Notifications
You must be signed in to change notification settings - Fork 121
AutoIndexing does not work well with transactions #353
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
Comments
Gasparila
added a commit
to flexport/algoliasearch-rails
that referenced
this issue
May 11, 2019
Fix breaking change introduced in algolia#352 According to the [documentation](https://github.com/algolia/algoliasearch-rails/blob/master/lib/README.md#630), using custom attributes without a custom `_changed?` method will always cause changes to push to the API. This behavior was lost in algolia#338 Fix unexpected behavior during transactions algolia#353 `@algolia_must_reindex` is reset in every validate call. This means that a record that is updated multiple times in a transaction will only be indexed if the final update marks as must reindex. Update the code so that once `@algolia_must_reindex` is marked as `true`, it remains true until explicitly unset in `algolia_perform_index_tasks`
Gasparila
added a commit
to flexport/algoliasearch-rails
that referenced
this issue
May 11, 2019
Fix breaking change introduced in algolia#352 According to the [documentation](https://github.com/algolia/algoliasearch-rails/blob/master/lib/README.md#630), using custom attributes without a custom `_changed?` method will always cause changes to push to the API. This behavior was lost in algolia#338 Fix unexpected behavior during transactions algolia#353 `@algolia_must_reindex` is reset in every validate call. This means that a record that is updated multiple times in a transaction will only be indexed if the final update marks as must reindex. Update the code so that once `@algolia_must_reindex` is marked as `true`, it remains true until explicitly unset in `algolia_perform_index_tasks`
Merged
Gasparila
added a commit
to flexport/algoliasearch-rails
that referenced
this issue
May 13, 2019
julienbourdeau
added a commit
that referenced
this issue
Jun 24, 2019
Fixed by #354 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
• Rails version: 5.1.6
• Algolia Rails integration version: 1.22
Description
@algolia_must_reindex
is reset in every validate call. This means that a recordthat is updated multiple times in a transaction will only be indexed if the
final update marks as must reindex
Steps To Reproduce
Suggested Fix
Change first line of def algolia_mark_must_reindex to
@algolia_must_reindex ||=
The text was updated successfully, but these errors were encountered: