meteorhacks/subs-manager — pull request #20 by gadicc (2014-11-26 16:09:49+00:00)
Title: Use EJSON instead of JSON for hash

Meteor subscribes work on EJSON, so the hashing should too. But there is a much bigger issue at stake here, subs manager malfunctions in phantomjs/spiderable because of:

```js
SubsManager.prototype.subscribe = function() {
this._addSub(arguments);
}
SubsManager.prototype._addSub = function(args) {
var hash = EJSON.stringify(args);
}
```

and [phantomjs#11845: Calling JSON.stringify on `arguments` fails](https://github.com/ariya/phantomjs/issues/11845). The resulting hash is `{}` for every sub, so only 1 sub is ever cached. This affects ready callbacks and I think is the cause of [#10: this.Ready() not called correctly with multiple different subscriptions on 1 subscription manager](https://github.com/meteorhacks/subs-manager/issues/10) (which mentions spiderable).