Meteor-Community-Packages / Meteor-Community-Packages/raix-push

Mass removal of tokens in Meteor 1.7

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.