Meteor-Community-Packages / Meteor-Community-Packages/ground-db

Remove using findOne leads to inconsistent state

Open
#190 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.