Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

ObjectiveDDP should handle multiple subscriptions to same subscription name with different parameters #158

Open
nsolter opened this issue Sep 16, 2015 · 0 comments

Comments

@nsolter
Copy link
Contributor

nsolter commented Sep 16, 2015

Currently, the subscription id is stored in _subscriptions, keyed by the subscriptionName. However, there could be multiple simultaneous subscriptions to the same subscription name, with different parameters. With the current data model, only the most recent subscription information is stored in _subscriptions (and _subscriptionsParameters).

This almost works, in that incoming messages for the older subscriptions are still processed. But there are two problems:

  1. removeSubscription - it's impossible to remove all but the most recent subscription to the same subscription name.
  2. _makeMeteorDataSubscriptions - this method only reconnects the most recent subscription for any given subscription name

I think the best approach is to key _subscriptions and _subscriptionsParameters on the subscriptionName + a hash of the params array. The default objective-c hash for nsarray is just the array length, so that won't be good enough, but we should be able to come up with something.

Note that if we take this approach, the code that sends out the "ready" notification might need to be updated as well to handle the new key structure. It's somewhat unclear to me whether we'd want the ready notification to still be for "_ready" or for something that takes the params into account.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant