Meteor-Community-Packages / Meteor-Community-Packages/ground-db
Remove using findOne leads to inconsistent state
- Dominant language
- JavaScript
- Stars
- 569
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
`remove` uses `findOne` to find the document to remove from localforage. This means that if the selector matches multiple documents then only one is removed from localforage, but all are removed from the Collection.
Also, that only one would be removed is inconsistent and non-obvious. Can all documents matching the selector be removed?
Contributor guide
Research direction
Start by locating the remove implementation and its use of findOne with localforage. Reproduce a selector matching multiple documents, then verify that every matching document is removed from both localforage and the Collection, adding or updating the relevant test if one is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100