Meteor-Community-Packages / Meteor-Community-Packages/raix-push
Mass removal of tokens in Meteor 1.7
- Dominant language
- JavaScript
- Stars
- 505
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
This is urgent. Just found that this piece of `raix:push-update` method:
```
// xxx: Hack
// Clean up mech making sure tokens are uniq - android sometimes generate
// new tokens resulting in duplicates
var removed = Push.appCollection.remove({
$and: [
{ _id: { $ne: doc._id } },
{ token: doc.token }, // Match token
{ appName: doc.appName }, // Match appName
{ token: { $exists: true } } // Make sure token exists
]
});
```
...is deleting all tokens from `_raix_push_app_tokens` collection some times!
Contributor guide
Research direction
Start at the raix:push-update method and inspect the shown Push.appCollection.remove query against the _raix_push_app_tokens collection. Reproduce the mass-deletion case, determine why the duplicate-token cleanup matches unrelated records, and add regression coverage showing that only intended duplicates are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100