{"action":"created","issue":{"url":"https://api.github.com/repos/kadirahq/flow-router/issues/352","labels_url":"https://api.github.com/repos/kadirahq/flow-router/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/kadirahq/flow-router/issues/352/comments","events_url":"https://api.github.com/repos/kadirahq/flow-router/issues/352/events","html_url":"https://github.com/kadirahq/flow-router/issues/352","id":111195031,"number":352,"title":"SSR Context Breaking CollectionFS methods","user":{"login":"zachariahtimothy","id":1346955,"avatar_url":"https://avatars.githubusercontent.com/u/1346955?v=3","gravatar_id":"","url":"https://api.github.com/users/zachariahtimothy","html_url":"https://github.com/zachariahtimothy","followers_url":"https://api.github.com/users/zachariahtimothy/followers","following_url":"https://api.github.com/users/zachariahtimothy/following{/other_user}","gists_url":"https://api.github.com/users/zachariahtimothy/gists{/gist_id}","starred_url":"https://api.github.com/users/zachariahtimothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachariahtimothy/subscriptions","organizations_url":"https://api.github.com/users/zachariahtimothy/orgs","repos_url":"https://api.github.com/users/zachariahtimothy/repos","events_url":"https://api.github.com/users/zachariahtimothy/events{/privacy}","received_events_url":"https://api.github.com/users/zachariahtimothy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kadirahq/flow-router/labels/question","name":"question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-13T14:42:07Z","updated_at":"2015-10-22T04:24:37Z","closed_at":"2015-10-22T04:24:37Z","body":"I have found on the server side rendering of React components the SSR context / Meteor.prototype.find()/findOne() methods break ColectionsFS .url() method for getting media URL's. (See issue: https://github.com/CollectionFS/Meteor-CollectionFS/issues/835). This makes me nervous of what other functionality overriding Mongo Collections might break. Is there a way to use hooks instead of overriding the Meteor mongo methods and breaking things like CollectionFS? \r\n\r\nNot sure if it is helpful, but I did confirm the query always runs through flow routers find prototype and it only breaks when ssr context is defined.  Here is the offending code:\r\n```\r\nMongo.Collection.prototype.find = function(selector, options) {                     // 20\r\n  selector = selector || {};                                                        // 21\r\n  var collName = this._name;                                                        // 22\r\n  var ssrContext = FlowRouter.ssrContext.get();                                     // 23\r\n  if(ssrContext && !FlowRouter.inSubscription.get()) {                              // 24\r\n    var collection = ssrContext.getCollection(collName);                            // 25\r\n    var cursor = collection.find(selector, options);                                // 26\r\n    return cursor;                                                                  // 27\r\n  }                                                                                 // 28\r\n                                                                                    // 29\r\n  return originalFind.call(this, selector, options);                                // 30\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/kadirahq/flow-router/issues/comments/150103286","html_url":"https://github.com/kadirahq/flow-router/issues/352#issuecomment-150103286","issue_url":"https://api.github.com/repos/kadirahq/flow-router/issues/352","id":150103286,"user":{"login":"arunoda","id":50838,"avatar_url":"https://avatars.githubusercontent.com/u/50838?v=3","gravatar_id":"","url":"https://api.github.com/users/arunoda","html_url":"https://github.com/arunoda","followers_url":"https://api.github.com/users/arunoda/followers","following_url":"https://api.github.com/users/arunoda/following{/other_user}","gists_url":"https://api.github.com/users/arunoda/gists{/gist_id}","starred_url":"https://api.github.com/users/arunoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunoda/subscriptions","organizations_url":"https://api.github.com/users/arunoda/orgs","repos_url":"https://api.github.com/users/arunoda/repos","events_url":"https://api.github.com/users/arunoda/events{/privacy}","received_events_url":"https://api.github.com/users/arunoda/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T04:24:37Z","updated_at":"2015-10-22T04:24:37Z","body":"I'm closing this for now. I can't think of a better way than this."}}