{"action":"created","issue":{"url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/11","repository_url":"https://api.github.com/repos/Hackzzila/Discord-Dart","labels_url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/11/comments","events_url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/11/events","html_url":"https://github.com/Hackzzila/Discord-Dart/pull/11","id":184677581,"number":11,"title":"Fix increasing number of heartbeats","user":{"login":"WinSuk","id":1295218,"avatar_url":"https://avatars.githubusercontent.com/u/1295218?v=3","gravatar_id":"","url":"https://api.github.com/users/WinSuk","html_url":"https://github.com/WinSuk","followers_url":"https://api.github.com/users/WinSuk/followers","following_url":"https://api.github.com/users/WinSuk/following{/other_user}","gists_url":"https://api.github.com/users/WinSuk/gists{/gist_id}","starred_url":"https://api.github.com/users/WinSuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WinSuk/subscriptions","organizations_url":"https://api.github.com/users/WinSuk/orgs","repos_url":"https://api.github.com/users/WinSuk/repos","events_url":"https://api.github.com/users/WinSuk/events{/privacy}","received_events_url":"https://api.github.com/users/WinSuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-23T08:18:22Z","updated_at":"2016-10-23T15:00:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Hackzzila/Discord-Dart/pulls/11","html_url":"https://github.com/Hackzzila/Discord-Dart/pull/11","diff_url":"https://github.com/Hackzzila/Discord-Dart/pull/11.diff","patch_url":"https://github.com/Hackzzila/Discord-Dart/pull/11.patch"},"body":"A new timer is created on every call to _heartbeat (line 54), but the initial timer on line 88 is already repeating (periodic).\r\nThis causes an increasing number of heartbeats to be sent every time - first 1, then 2 at the same time, 3 at the same time, etc.\r\n\r\nThis is what it looks like with some logging added:\r\n> 00:31:29.312696 - sending heartbeat\r\n>\r\n> 00:32:10.556355 - sending heartbeat\r\n> 00:32:10.564373 - sending heartbeat\r\n>\r\n> 00:32:51.806284 - sending heartbeat\r\n> 00:32:51.807203 - sending heartbeat\r\n> 00:32:51.815339 - sending heartbeat\r\n>\r\n> 00:33:33.056295 - sending heartbeat\r\n> 00:33:33.057198 - sending heartbeat\r\n> 00:33:33.058201 - sending heartbeat\r\n> 00:33:33.066252 - sending heartbeat\r\n>\r\n> 00:34:14.306295 - sending heartbeat\r\n> 00:34:14.307213 - sending heartbeat\r\n> 00:34:14.308197 - sending heartbeat\r\n> 00:34:14.309201 - sending heartbeat\r\n> 00:34:14.317346 - sending heartbeat\r\n>\r\n> 00:34:55.556343 - sending heartbeat\r\n> 00:34:55.557282 - sending heartbeat\r\n> 00:34:55.558252 - sending heartbeat\r\n> 00:34:55.559393 - sending heartbeat\r\n> 00:34:55.560209 - sending heartbeat\r\n> 00:34:55.568282 - sending heartbeat\r\n\r\nAfter about 45 minutes, Discord drops the connection for ratelimiting :grin:\r\n\r\nI'm not completely sure if line 54 should be removed, or if 88 should be changed to be non-periodic instead. Feel free to drop this PR and do that instead if it fits better :+1: "},"comment":{"url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/comments/255593413","html_url":"https://github.com/Hackzzila/Discord-Dart/pull/11#issuecomment-255593413","issue_url":"https://api.github.com/repos/Hackzzila/Discord-Dart/issues/11","id":255593413,"user":{"login":"Hackzzila","id":11618364,"avatar_url":"https://avatars.githubusercontent.com/u/11618364?v=3","gravatar_id":"","url":"https://api.github.com/users/Hackzzila","html_url":"https://github.com/Hackzzila","followers_url":"https://api.github.com/users/Hackzzila/followers","following_url":"https://api.github.com/users/Hackzzila/following{/other_user}","gists_url":"https://api.github.com/users/Hackzzila/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackzzila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackzzila/subscriptions","organizations_url":"https://api.github.com/users/Hackzzila/orgs","repos_url":"https://api.github.com/users/Hackzzila/repos","events_url":"https://api.github.com/users/Hackzzila/events{/privacy}","received_events_url":"https://api.github.com/users/Hackzzila/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T15:00:41Z","updated_at":"2016-10-23T15:00:41Z","body":"🤔 I don't know why it is that way."}}
{"actor":{"display_login":"Hackzzila"}}