-
Notifications
You must be signed in to change notification settings - Fork 94
Fix AggregatorObserver sync status #356
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 AggregatorObserver sync status #356
Conversation
|
@qmeister Thanks for making this, I'd love to see this merged in Seems like some tests are failing to connect to a test environment? Unsure what's going on there but I guess there's not much we can do about it |
Thanks @kellerjmrtn! Looks like these tests are good now though. @DevinCodes could you review this PR and/or let me know if you need anything from me to get this merged in? |
DevinCodes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @qmeister ,
Thanks for the PR! Were you able to confirm on your end this behaves as expected? The code changes look good to me in general, but we're missing a test that confirms the expected behaviour 🙂
ce00ede to
a5895a2
Compare
Hi @DevinCodes , Thanks for the review and good call!! - Just added tests to confirm this :) And yes, I can confirm this works as it should ... But ... Actually, while writing these tests I saw that my implementation was not correct. It works as expected, because I set So, I've removed the Further notes (FYI):
|
a5895a2 to
423c167
Compare
DevinCodes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @qmeister 🙇♂️ I'll release this tomorrow in the morning!
|
This is out now in https://github.com/algolia/scout-extended/releases/tag/v3.2.2 ! Thanks again for the contribution 😄 |
Awesome, thank you! |
Describe your change
Currently, the
deletedandforceDeletedevent handlers are disabled inAggregatorObserverifdisableSearchSyncinghas been set for an aggregator model. This should only disable the event handlers for the aggregator models and not the event handlers for aggregator class itself. For thisdisableSearchSyncingshould only be handled by theModelObserverand not by theAggregatorObserverlike it is currently implemented with thesavedevent handler inModelObserverandAggregatorObserver.What problem is this fixing?
Currently, if multiple models are used in one index by using an aggregator and you don't want these to sync also by using
disableSearchSyncing, these models won't be removed from the index on a delete, because theAggregatorObserverrespects the disableSearchSyncing from its models while this should be respected by theModelObserveronly.See Multiple models in one index article for feature reference.