{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/3194","labels_url":"https://api.github.com/repos/meteor/meteor/issues/3194/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/3194/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/3194/events","html_url":"https://github.com/meteor/meteor/issues/3194","id":50307613,"number":3194,"title":"Subscription not ready in onReady callback","user":{"login":"steph643","id":7039479,"avatar_url":"https://avatars.githubusercontent.com/u/7039479?v=3","gravatar_id":"","url":"https://api.github.com/users/steph643","html_url":"https://github.com/steph643","followers_url":"https://api.github.com/users/steph643/followers","following_url":"https://api.github.com/users/steph643/following{/other_user}","gists_url":"https://api.github.com/users/steph643/gists{/gist_id}","starred_url":"https://api.github.com/users/steph643/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steph643/subscriptions","organizations_url":"https://api.github.com/users/steph643/orgs","repos_url":"https://api.github.com/users/steph643/repos","events_url":"https://api.github.com/users/steph643/events{/privacy}","received_events_url":"https://api.github.com/users/steph643/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-11-27T16:26:27Z","updated_at":"2015-10-05T21:32:20Z","closed_at":"2015-01-07T23:49:49Z","body":"In Deps.autorun, when using a session variable to modify a subscription, the onReady() callback\r\nis called when data is not ready yet. Using setTimeout(0) solves the problem.\r\n\r\nTested on Meteor 0.8.3 and WINDOWS-PREVIEW@0.0.8\r\n\r\nHere is the repo to reproduce (see README.md): https://github.com/steph643/meteor-issue-3194/\r\n\r\nIssue also reported by someone else here: http://stackoverflow.com/questions/24103652/subscriptions-onready-called-when-cursor-is-not-ready/27174142"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/145674665","html_url":"https://github.com/meteor/meteor/issues/3194#issuecomment-145674665","issue_url":"https://api.github.com/repos/meteor/meteor/issues/3194","id":145674665,"user":{"login":"mitar","id":585279,"avatar_url":"https://avatars.githubusercontent.com/u/585279?v=3","gravatar_id":"","url":"https://api.github.com/users/mitar","html_url":"https://github.com/mitar","followers_url":"https://api.github.com/users/mitar/followers","following_url":"https://api.github.com/users/mitar/following{/other_user}","gists_url":"https://api.github.com/users/mitar/gists{/gist_id}","starred_url":"https://api.github.com/users/mitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitar/subscriptions","organizations_url":"https://api.github.com/users/mitar/orgs","repos_url":"https://api.github.com/users/mitar/repos","events_url":"https://api.github.com/users/mitar/events{/privacy}","received_events_url":"https://api.github.com/users/mitar/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T21:32:20Z","updated_at":"2015-10-05T21:32:20Z","body":"No, I am using reactivity to wait for the subscription `ready()` to be `true`. Once it is `true`, I would assume (from @glasser comment) that I can be assure that the collection is updated with the state from the server-side publish. So I am using reactivity to wait for subscription `ready()` to be true."}}