inProgress-team / inProgress-team/react-native-meteor
Question: Access to subscriptionId in DDP 'added' event
- Dominant language
- JavaScript
- Stars
- 688
- Forks
- 200
- PR merge metrics
- No merged PRs in 30d
Description
Hey guys,
I'm working on a thorny issue (https://github.com/DesignmanIO/react-native-meteor-redux/issues/29), basically I need to be able to sync documents when I come online again. The difficulty is knowing when a particular document has been removed while offline, vs when it's just been unsubscribed from. My proposed solution for this is to store a lookup table for each unique subscription (a unique subscription being it's name + stringified params), associating it with the document _ids that it fetches. The problem is I can't figure out where information on both the subscription and documents is available at the same time.
Ideally, I'd be able to use the ddp added, removed, and changed hooks, and know which subscription is producing those documents. My suspicion is that it's not that easy... If there are multiple pub/subs, then the docs are probably sent in aggregate. There must be some way to tell what docs are being sent by a subscription?
It looks like the Meteor subscription includes `_subscriptionId` into it's `this` property.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.