Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.
This repository was 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

@nsolter

Description

@nsolter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions