payload
payload copied to clipboard
fix(searchPlugin): ensure search updates are unique to collection
Description
Our app is using the searchPlugin
with two different collections. We were having issues with search results disappearing randomly when we saved certain records.
After digging in, we found that the syncWithSearch
hook is only searching for matching search
records by id
, not relationTo
.
This resulted in the syncWithSearch
hook incorrectly overwriting records in the wrong collection if they share the same ID. This patch resolves the issue.
- [x] I have read and understand the CONTRIBUTING.md document in this repository.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
Checklist:
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] Existing test suite passes locally with my changes
I did run the test suite locally but it seems to be failing for other unrelated reasons
@lynndylanhurley I think your fix makes sense. I don't think the failing tests are related.