{"action":"closed","number":207,"pull_request":{"url":"https://api.github.com/repos/quassel/quassel/pulls/207","id":73199683,"html_url":"https://github.com/quassel/quassel/pull/207","diff_url":"https://github.com/quassel/quassel/pull/207.diff","patch_url":"https://github.com/quassel/quassel/pull/207.patch","issue_url":"https://api.github.com/repos/quassel/quassel/issues/207","number":207,"state":"closed","locked":false,"title":"Fix sending quit messages on core shutdown (simpler)","user":{"login":"digitalcircuit","id":1449717,"avatar_url":"https://avatars.githubusercontent.com/u/1449717?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalcircuit","html_url":"https://github.com/digitalcircuit","followers_url":"https://api.github.com/users/digitalcircuit/followers","following_url":"https://api.github.com/users/digitalcircuit/following{/other_user}","gists_url":"https://api.github.com/users/digitalcircuit/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalcircuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalcircuit/subscriptions","organizations_url":"https://api.github.com/users/digitalcircuit/orgs","repos_url":"https://api.github.com/users/digitalcircuit/repos","events_url":"https://api.github.com/users/digitalcircuit/events{/privacy}","received_events_url":"https://api.github.com/users/digitalcircuit/received_events","type":"User","site_admin":false},"body":"## In short\r\n* When shutting down the core, disconnect all sessions' networks first\r\n * Call happens via ```CoreSession``` destructor, waiting up to 1 second\r\n * *Pending [pull request #201](https://github.com/quassel/quassel/pull/201 )*, prioritize ```QUIT``` over queued messages to ensure a graceful disconnect\r\n\r\nCriteria | Rank | Reason\r\n---------|---------|-------------\r\nImpact | ★★☆ *2/3* | User-facing polish, visible to other clients\r\nRisk | ★★☆ *2/3* | Slightly slower shutdown, edge-cases might block normal quit\r\nIntrusiveness | ★☆☆ *1/3* | Small set of changes, shouldn't interfere with other pull requests\r\n\r\n```\r\nFrom this:\r\n<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Input/output error)\r\nTo this:\r\n<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Quit: My Message!)\r\n```\r\n\r\n*Previously submitted as [pull request #203](https://github.com/quassel/quassel/pull/203 ) using a more complex signals/slots layout.  Thanks to @seezer for the suggestions!*\r\n\r\n**Depends upon [pull request #201](https://github.com/quassel/quassel/pull/201 ) to work more reliably.  If the former is merged, this will need updated.**\r\n\r\n## Rationale\r\nThis addresses two small matters of polish.\r\n\r\nFirst, Quassel should send a ```QUIT``` when shutting down to make use of the \"Quit Reason\" in the identity settings.  Having the core shutdown may be one of the most common methods of quitting, whether via closing the monolithic client or ```upstart```, ```systemd```, ```sysvinit```, etc managing the ```quasselcore``` service.  Simply dropping the socket as done now seems somewhat haphazard.\r\n\r\nSecond, by properly waiting to ```QUIT``` and disconnect, Quassel now logs disconnects in the chat history.  This reduces confusion over what happened, and simplifies distinguishing between a controlled shutdown and a power outage or crash.\r\n\r\n## Implementation\r\n* Send ```QUIT``` when core is shutting down, treating it as a non-requested\r\ndisconnect (*core will reconnect on next launch*)\r\n * Happens inside ```~CoreSession()```, called during ```___Application::quit()```\r\n * If sockets aren't closed within 1 second, Quassel quits immediately like before\r\n\r\n*Other approaches are possible; constructive criticism is welcome!*\r\n\r\n## Testing\r\n### Test results\r\n\r\n**Success** (*properly sends ```QUIT```*)\r\n* ```Ctrl-C``` ```quasselcore``` in terminal\r\n* ```Upstart```/```systemd``` shutting down ```quasselcore```\r\n* Closing monolithic client with ```Ctrl-Q```/close button/etc (*Win/Linux*)\r\n* Shutting down Linux desktop session with monolithic client without first closing the window\r\n\r\n**Failure** (*behaves as before, dropping socket*)\r\n* Shutting down Windows desktop session with monolithic client without first closing the window\r\n* Shutting down standalone core on Windows\r\n\r\n### Examples\r\n**Unreal 3.2**\r\n```\r\n> Before\r\n<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Input/output error)\r\n> After\r\n<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Quit: My Message!)\r\n```\r\n**Freenode**\r\n```\r\n> Before\r\n<-- dcircuit_dev (~quasselde@hostmask) has quit (Remote host closed the connection)\r\n> After\r\n<-- dcircuit_dev (~quasselde@hostmask) has quit (Quit: My Message!)\r\n```\r\n\r\nWhere \"My Message!\" is specified in Configure Quassel → IRC → Identities → Advanced → Quit Reason\r\n\r\n*Note: Freenode hides quit messages from clients that disconnect soon after connecting.  Stay connected ~10 minutes before testing quit.*","created_at":"2016-06-09T11:45:24Z","updated_at":"2016-09-06T20:34:21Z","closed_at":"2016-09-06T20:34:21Z","merged_at":null,"merge_commit_sha":"4bf7b0461f62b7ba7880275dacef2be235f2aa36","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/quassel/quassel/pulls/207/commits","review_comments_url":"https://api.github.com/repos/quassel/quassel/pulls/207/comments","review_comment_url":"https://api.github.com/repos/quassel/quassel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quassel/quassel/issues/207/comments","statuses_url":"https://api.github.com/repos/quassel/quassel/statuses/fb40d03fe4f31e9cea21102d066806be90fdcf4a","head":{"label":"digitalcircuit:fix-shutdown-send-quit-simple","ref":"fix-shutdown-send-quit-simple","sha":"fb40d03fe4f31e9cea21102d066806be90fdcf4a","user":{"login":"digitalcircuit","id":1449717,"avatar_url":"https://avatars.githubusercontent.com/u/1449717?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalcircuit","html_url":"https://github.com/digitalcircuit","followers_url":"https://api.github.com/users/digitalcircuit/followers","following_url":"https://api.github.com/users/digitalcircuit/following{/other_user}","gists_url":"https://api.github.com/users/digitalcircuit/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalcircuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalcircuit/subscriptions","organizations_url":"https://api.github.com/users/digitalcircuit/orgs","repos_url":"https://api.github.com/users/digitalcircuit/repos","events_url":"https://api.github.com/users/digitalcircuit/events{/privacy}","received_events_url":"https://api.github.com/users/digitalcircuit/received_events","type":"User","site_admin":false},"repo":{"id":50971160,"name":"quassel","full_name":"digitalcircuit/quassel","owner":{"login":"digitalcircuit","id":1449717,"avatar_url":"https://avatars.githubusercontent.com/u/1449717?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalcircuit","html_url":"https://github.com/digitalcircuit","followers_url":"https://api.github.com/users/digitalcircuit/followers","following_url":"https://api.github.com/users/digitalcircuit/following{/other_user}","gists_url":"https://api.github.com/users/digitalcircuit/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalcircuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalcircuit/subscriptions","organizations_url":"https://api.github.com/users/digitalcircuit/orgs","repos_url":"https://api.github.com/users/digitalcircuit/repos","events_url":"https://api.github.com/users/digitalcircuit/events{/privacy}","received_events_url":"https://api.github.com/users/digitalcircuit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/digitalcircuit/quassel","description":"Quassel IRC","fork":true,"url":"https://api.github.com/repos/digitalcircuit/quassel","forks_url":"https://api.github.com/repos/digitalcircuit/quassel/forks","keys_url":"https://api.github.com/repos/digitalcircuit/quassel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalcircuit/quassel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalcircuit/quassel/teams","hooks_url":"https://api.github.com/repos/digitalcircuit/quassel/hooks","issue_events_url":"https://api.github.com/repos/digitalcircuit/quassel/issues/events{/number}","events_url":"https://api.github.com/repos/digitalcircuit/quassel/events","assignees_url":"https://api.github.com/repos/digitalcircuit/quassel/assignees{/user}","branches_url":"https://api.github.com/repos/digitalcircuit/quassel/branches{/branch}","tags_url":"https://api.github.com/repos/digitalcircuit/quassel/tags","blobs_url":"https://api.github.com/repos/digitalcircuit/quassel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalcircuit/quassel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalcircuit/quassel/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalcircuit/quassel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalcircuit/quassel/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalcircuit/quassel/languages","stargazers_url":"https://api.github.com/repos/digitalcircuit/quassel/stargazers","contributors_url":"https://api.github.com/repos/digitalcircuit/quassel/contributors","subscribers_url":"https://api.github.com/repos/digitalcircuit/quassel/subscribers","subscription_url":"https://api.github.com/repos/digitalcircuit/quassel/subscription","commits_url":"https://api.github.com/repos/digitalcircuit/quassel/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalcircuit/quassel/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalcircuit/quassel/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalcircuit/quassel/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalcircuit/quassel/contents/{+path}","compare_url":"https://api.github.com/repos/digitalcircuit/quassel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalcircuit/quassel/merges","archive_url":"https://api.github.com/repos/digitalcircuit/quassel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalcircuit/quassel/downloads","issues_url":"https://api.github.com/repos/digitalcircuit/quassel/issues{/number}","pulls_url":"https://api.github.com/repos/digitalcircuit/quassel/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalcircuit/quassel/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalcircuit/quassel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalcircuit/quassel/labels{/name}","releases_url":"https://api.github.com/repos/digitalcircuit/quassel/releases{/id}","deployments_url":"https://api.github.com/repos/digitalcircuit/quassel/deployments","created_at":"2016-02-03T03:29:07Z","updated_at":"2016-02-03T03:29:10Z","pushed_at":"2016-09-06T09:49:31Z","git_url":"git://github.com/digitalcircuit/quassel.git","ssh_url":"git@github.com:digitalcircuit/quassel.git","clone_url":"https://github.com/digitalcircuit/quassel.git","svn_url":"https://github.com/digitalcircuit/quassel","homepage":null,"size":25067,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"quassel:master","ref":"master","sha":"9219f29de491af4a990deec79e658ccf2ab9f9bf","user":{"login":"quassel","id":2965670,"avatar_url":"https://avatars.githubusercontent.com/u/2965670?v=3","gravatar_id":"","url":"https://api.github.com/users/quassel","html_url":"https://github.com/quassel","followers_url":"https://api.github.com/users/quassel/followers","following_url":"https://api.github.com/users/quassel/following{/other_user}","gists_url":"https://api.github.com/users/quassel/gists{/gist_id}","starred_url":"https://api.github.com/users/quassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quassel/subscriptions","organizations_url":"https://api.github.com/users/quassel/orgs","repos_url":"https://api.github.com/users/quassel/repos","events_url":"https://api.github.com/users/quassel/events{/privacy}","received_events_url":"https://api.github.com/users/quassel/received_events","type":"Organization","site_admin":false},"repo":{"id":7007419,"name":"quassel","full_name":"quassel/quassel","owner":{"login":"quassel","id":2965670,"avatar_url":"https://avatars.githubusercontent.com/u/2965670?v=3","gravatar_id":"","url":"https://api.github.com/users/quassel","html_url":"https://github.com/quassel","followers_url":"https://api.github.com/users/quassel/followers","following_url":"https://api.github.com/users/quassel/following{/other_user}","gists_url":"https://api.github.com/users/quassel/gists{/gist_id}","starred_url":"https://api.github.com/users/quassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quassel/subscriptions","organizations_url":"https://api.github.com/users/quassel/orgs","repos_url":"https://api.github.com/users/quassel/repos","events_url":"https://api.github.com/users/quassel/events{/privacy}","received_events_url":"https://api.github.com/users/quassel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quassel/quassel","description":"Quassel IRC","fork":false,"url":"https://api.github.com/repos/quassel/quassel","forks_url":"https://api.github.com/repos/quassel/quassel/forks","keys_url":"https://api.github.com/repos/quassel/quassel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quassel/quassel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quassel/quassel/teams","hooks_url":"https://api.github.com/repos/quassel/quassel/hooks","issue_events_url":"https://api.github.com/repos/quassel/quassel/issues/events{/number}","events_url":"https://api.github.com/repos/quassel/quassel/events","assignees_url":"https://api.github.com/repos/quassel/quassel/assignees{/user}","branches_url":"https://api.github.com/repos/quassel/quassel/branches{/branch}","tags_url":"https://api.github.com/repos/quassel/quassel/tags","blobs_url":"https://api.github.com/repos/quassel/quassel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quassel/quassel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quassel/quassel/git/refs{/sha}","trees_url":"https://api.github.com/repos/quassel/quassel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quassel/quassel/statuses/{sha}","languages_url":"https://api.github.com/repos/quassel/quassel/languages","stargazers_url":"https://api.github.com/repos/quassel/quassel/stargazers","contributors_url":"https://api.github.com/repos/quassel/quassel/contributors","subscribers_url":"https://api.github.com/repos/quassel/quassel/subscribers","subscription_url":"https://api.github.com/repos/quassel/quassel/subscription","commits_url":"https://api.github.com/repos/quassel/quassel/commits{/sha}","git_commits_url":"https://api.github.com/repos/quassel/quassel/git/commits{/sha}","comments_url":"https://api.github.com/repos/quassel/quassel/comments{/number}","issue_comment_url":"https://api.github.com/repos/quassel/quassel/issues/comments{/number}","contents_url":"https://api.github.com/repos/quassel/quassel/contents/{+path}","compare_url":"https://api.github.com/repos/quassel/quassel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quassel/quassel/merges","archive_url":"https://api.github.com/repos/quassel/quassel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quassel/quassel/downloads","issues_url":"https://api.github.com/repos/quassel/quassel/issues{/number}","pulls_url":"https://api.github.com/repos/quassel/quassel/pulls{/number}","milestones_url":"https://api.github.com/repos/quassel/quassel/milestones{/number}","notifications_url":"https://api.github.com/repos/quassel/quassel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quassel/quassel/labels{/name}","releases_url":"https://api.github.com/repos/quassel/quassel/releases{/id}","deployments_url":"https://api.github.com/repos/quassel/quassel/deployments","created_at":"2012-12-04T21:43:06Z","updated_at":"2016-08-25T07:14:56Z","pushed_at":"2016-09-06T20:34:18Z","git_url":"git://github.com/quassel/quassel.git","ssh_url":"git@github.com:quassel/quassel.git","clone_url":"https://github.com/quassel/quassel.git","svn_url":"https://github.com/quassel/quassel","homepage":null,"size":28161,"stargazers_count":319,"watchers_count":319,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":139,"mirror_url":null,"open_issues_count":34,"forks":139,"open_issues":34,"watchers":319,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quassel/quassel/pulls/207"},"html":{"href":"https://github.com/quassel/quassel/pull/207"},"issue":{"href":"https://api.github.com/repos/quassel/quassel/issues/207"},"comments":{"href":"https://api.github.com/repos/quassel/quassel/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/quassel/quassel/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/quassel/quassel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quassel/quassel/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/quassel/quassel/statuses/fb40d03fe4f31e9cea21102d066806be90fdcf4a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":2,"review_comments":0,"commits":3,"additions":92,"deletions":3,"changed_files":3}}
{"actor":{"display_login":"Sput42"}}