{"action":"created","issue":{"url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/6","labels_url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/6/comments","events_url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/6/events","html_url":"https://github.com/richsilv/meteor-dumb-collections/issues/6","id":61299775,"number":6,"title":".ironRouterReay() incorrect","user":{"login":"Colecf","id":350553,"avatar_url":"https://avatars.githubusercontent.com/u/350553?v=3","gravatar_id":"","url":"https://api.github.com/users/Colecf","html_url":"https://github.com/Colecf","followers_url":"https://api.github.com/users/Colecf/followers","following_url":"https://api.github.com/users/Colecf/following{/other_user}","gists_url":"https://api.github.com/users/Colecf/gists{/gist_id}","starred_url":"https://api.github.com/users/Colecf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Colecf/subscriptions","organizations_url":"https://api.github.com/users/Colecf/orgs","repos_url":"https://api.github.com/users/Colecf/repos","events_url":"https://api.github.com/users/Colecf/events{/privacy}","received_events_url":"https://api.github.com/users/Colecf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-13T23:51:29Z","updated_at":"2015-03-14T18:40:08Z","closed_at":"2015-03-14T18:40:08Z","body":"So I'm trying to make a page wait for a dumbcollection sync before displaying, but around half the time (sometimes it works, I think when I already have the necessary element in localStorage) I get stuck on the loading screen. When on the loading screen, I enter this into the chrome developer console:\r\n\r\n    classCollection.ready()\r\n    true\r\n    classCollection.ironRouterReady().ready()\r\n    false\r\n\r\nSo for some reason ironRouterReady() doesn't seem to ever be updating to true. This is the routing code:\r\n\r\n```\r\nRouter.route('/classinfo/:classNum', {\r\n  onRun: function() {\r\n    classCollection.sync({retain: true, query:{classNum: this.params.classNum}});\r\n    this.next();\r\n  },\r\n  loadingTemplate: 'loading',\r\n  waitOn: function() {\r\n    return classCollection.ironRouterReady();\r\n  },\r\n  action: function() {\r\n    var classNum = parseInt(this.params.classNum);\r\n    if(classNum === NaN) {\r\n      this.render('unknownClass');\r\n      return;\r\n    }\r\n    var theClass = classCollection.findOne({classNum: classNum});\r\n    if(theClass) {\r\n      this.render(\"classDetails\", { data: function() {\r\n        return theClass;\r\n      }});\r\n    } else {\r\n      this.render('unknownClass');\r\n    }\r\n  },\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/comments/80662425","html_url":"https://github.com/richsilv/meteor-dumb-collections/issues/6#issuecomment-80662425","issue_url":"https://api.github.com/repos/richsilv/meteor-dumb-collections/issues/6","id":80662425,"user":{"login":"richsilv","id":3180526,"avatar_url":"https://avatars.githubusercontent.com/u/3180526?v=3","gravatar_id":"","url":"https://api.github.com/users/richsilv","html_url":"https://github.com/richsilv","followers_url":"https://api.github.com/users/richsilv/followers","following_url":"https://api.github.com/users/richsilv/following{/other_user}","gists_url":"https://api.github.com/users/richsilv/gists{/gist_id}","starred_url":"https://api.github.com/users/richsilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsilv/subscriptions","organizations_url":"https://api.github.com/users/richsilv/orgs","repos_url":"https://api.github.com/users/richsilv/repos","events_url":"https://api.github.com/users/richsilv/events{/privacy}","received_events_url":"https://api.github.com/users/richsilv/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T18:40:08Z","updated_at":"2015-03-14T18:40:08Z","body":"Thanks for raising.\r\n\r\n`ironRouterReady().ready()` returns a reactive variable which gives the synced status of the collection, whereas `ready()` just indicates whether it's ready to be used (i.e. localStorage has been checked and docs inserted), so they're different things.\r\n\r\nThe problem here was that passing `retain` or `reject` prevented the `synced` flag ever being set due to a bug, which is why `ironRouterReady().ready()` was always false if there were extra docs to be added from the server.\r\n\r\nI've just published a new version correcting this bug.  Thanks."}}