{"action":"created","issue":{"url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/9","labels_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/9/comments","events_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/9/events","html_url":"https://github.com/tavendo/AutobahnJS/issues/9","id":5755897,"number":9,"title":"Automatic reestablishment of prefixes and subscriptions upon reconnect","user":{"login":"oberstet","id":233340,"avatar_url":"https://avatars.githubusercontent.com/u/233340?v=3","gravatar_id":"","url":"https://api.github.com/users/oberstet","html_url":"https://github.com/oberstet","followers_url":"https://api.github.com/users/oberstet/followers","following_url":"https://api.github.com/users/oberstet/following{/other_user}","gists_url":"https://api.github.com/users/oberstet/gists{/gist_id}","starred_url":"https://api.github.com/users/oberstet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oberstet/subscriptions","organizations_url":"https://api.github.com/users/oberstet/orgs","repos_url":"https://api.github.com/users/oberstet/repos","events_url":"https://api.github.com/users/oberstet/events{/privacy}","received_events_url":"https://api.github.com/users/oberstet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tavendo/AutobahnJS/labels/feature","name":"feature","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2012-07-21T20:07:18Z","updated_at":"2015-01-06T15:23:01Z","closed_at":"2014-02-24T15:26:08Z","body":"The lifetime of topic subscription with AutobahnJS starts with subscribe() and ends with unsubscribe() or at latest with the end of the session.\r\n\r\nAn application may want to resubscribe all topics upon a reconnect of session automatically.\r\n\r\nAPI-wise, the only thing needed would be an option to activate this behavior.\r\n\r\nInternally, the subscription table with all event handler should be saved when the session is lost, and all subscription reactivated upon reconnect."},"comment":{"url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/comments/68878684","html_url":"https://github.com/tavendo/AutobahnJS/issues/9#issuecomment-68878684","issue_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/9","id":68878684,"user":{"login":"activeperception","id":6286377,"avatar_url":"https://avatars.githubusercontent.com/u/6286377?v=3","gravatar_id":"","url":"https://api.github.com/users/activeperception","html_url":"https://github.com/activeperception","followers_url":"https://api.github.com/users/activeperception/followers","following_url":"https://api.github.com/users/activeperception/following{/other_user}","gists_url":"https://api.github.com/users/activeperception/gists{/gist_id}","starred_url":"https://api.github.com/users/activeperception/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/activeperception/subscriptions","organizations_url":"https://api.github.com/users/activeperception/orgs","repos_url":"https://api.github.com/users/activeperception/repos","events_url":"https://api.github.com/users/activeperception/events{/privacy}","received_events_url":"https://api.github.com/users/activeperception/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T15:23:01Z","updated_at":"2015-01-06T15:23:01Z","body":"Hi, \r\n\r\nI'm finding this to be an issue in my application and can't think of any other way to go about it. \r\n\r\nIn a decently sized application you would expect the registration / subscriptions to be 'distributed' across multiple classes/components/controllers therefore not all re-registration can happen in the onopen method. \r\n\r\nFor our app we're storing the registrations/subscriptions in a AngularJS factory that also abstracts all controllers from Autobahn details. On reconnect we iterate through the stored registrations/subscriptions and re-register...this is something that can probably be done in an easier and cleaner way internally by autobahn using session.subscriptions and session.registrations. What do you think?\r\n\r\n/Raffaele\r\n\r\n"}}