{"action":"created","issue":{"url":"https://api.github.com/repos/pontarius/pontarius-service/issues/13","labels_url":"https://api.github.com/repos/pontarius/pontarius-service/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/pontarius/pontarius-service/issues/13/comments","events_url":"https://api.github.com/repos/pontarius/pontarius-service/issues/13/events","html_url":"https://github.com/pontarius/pontarius-service/issues/13","id":110229493,"number":13,"title":"Handle peer states","user":{"login":"Philonous","id":558171,"avatar_url":"https://avatars.githubusercontent.com/u/558171?v=3","gravatar_id":"","url":"https://api.github.com/users/Philonous","html_url":"https://github.com/Philonous","followers_url":"https://api.github.com/users/Philonous/followers","following_url":"https://api.github.com/users/Philonous/following{/other_user}","gists_url":"https://api.github.com/users/Philonous/gists{/gist_id}","starred_url":"https://api.github.com/users/Philonous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Philonous/subscriptions","organizations_url":"https://api.github.com/users/Philonous/orgs","repos_url":"https://api.github.com/users/Philonous/repos","events_url":"https://api.github.com/users/Philonous/events{/privacy}","received_events_url":"https://api.github.com/users/Philonous/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pontarius/pontarius-service/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-07T13:48:34Z","updated_at":"2015-10-20T13:44:14Z","closed_at":null,"body":"### Rosters\n\nWe have to handle two rosters:\n* The local roster (peer information stored in the DB)\n* The remote roster (peer information stored on the server, e.g. the XMPP roster)\n\nWhen adding a peer, we always try to add it both to the local and the remote roster.\n\n### States to handle\n\nCases to handle:\n* __0__. A peer is added remotely and locally. Nothing to do\n* __1__. A peer is added locally, but can't be added remotely (e.g. the JIDs domain part isn't a valid server)\n* __2__. A peer was sucessfully added locally and remotely, but was remotely removed later (e.g. user logs in with another client and removes it)\n* __3__. A peer was added remotely but not locally (User logs in woth another client and adds the peer)\n* __3a__. The remote peer could be in a pending-out or pending-in state\n* __4__. A peer was added remotely and locally and later removed locally, but not remotely because the service was offline. It should be removed remotely once the service goes online again\n* __5__. A peer was added locally while the service was offline. It should be added remotely once the service comes online again\n\n### Ghosts \n__1__. and __2__. would be considered __ghosts__. \n\n* Ghosts peers appear offline\n* Users should be able to see a list of ghosts for handling \n* Users should be able to handle ghosts the same way they handle other peers with the additional option to re-add the peer remotely.\n\n\n\n<!---\n@huboard:{\"order\":0.0625,\"milestone_order\":0.0625,\"custom_state\":\"\"}\n-->\n"},"comment":{"url":"https://api.github.com/repos/pontarius/pontarius-service/issues/comments/149572421","html_url":"https://github.com/pontarius/pontarius-service/issues/13#issuecomment-149572421","issue_url":"https://api.github.com/repos/pontarius/pontarius-service/issues/13","id":149572421,"user":{"login":"jonkri","id":777056,"avatar_url":"https://avatars.githubusercontent.com/u/777056?v=3","gravatar_id":"","url":"https://api.github.com/users/jonkri","html_url":"https://github.com/jonkri","followers_url":"https://api.github.com/users/jonkri/followers","following_url":"https://api.github.com/users/jonkri/following{/other_user}","gists_url":"https://api.github.com/users/jonkri/gists{/gist_id}","starred_url":"https://api.github.com/users/jonkri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonkri/subscriptions","organizations_url":"https://api.github.com/users/jonkri/orgs","repos_url":"https://api.github.com/users/jonkri/repos","events_url":"https://api.github.com/users/jonkri/events{/privacy}","received_events_url":"https://api.github.com/users/jonkri/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T13:44:14Z","updated_at":"2015-10-20T13:44:14Z","body":"See also https://github.com/pontarius/pontarius-service/wiki/Peer-state-transition-matrix."}}