{"action":"created","issue":{"url":"https://api.github.com/repos/primus/primus/issues/348","labels_url":"https://api.github.com/repos/primus/primus/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/primus/primus/issues/348/comments","events_url":"https://api.github.com/repos/primus/primus/issues/348/events","html_url":"https://github.com/primus/primus/issues/348","id":59451044,"number":348,"title":"Irregular heartbeats with Safari","user":{"login":"ookke","id":237161,"avatar_url":"https://avatars.githubusercontent.com/u/237161?v=3","gravatar_id":"","url":"https://api.github.com/users/ookke","html_url":"https://github.com/ookke","followers_url":"https://api.github.com/users/ookke/followers","following_url":"https://api.github.com/users/ookke/following{/other_user}","gists_url":"https://api.github.com/users/ookke/gists{/gist_id}","starred_url":"https://api.github.com/users/ookke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ookke/subscriptions","organizations_url":"https://api.github.com/users/ookke/orgs","repos_url":"https://api.github.com/users/ookke/repos","events_url":"https://api.github.com/users/ookke/events{/privacy}","received_events_url":"https://api.github.com/users/ookke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/primus/primus/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/primus/primus/labels/Safari","name":"Safari","color":"bfe5bf"},{"url":"https://api.github.com/repos/primus/primus/labels/%E2%98%85","name":"★","color":"f1f1f1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-02T08:22:20Z","updated_at":"2015-09-26T08:13:31Z","closed_at":null,"body":"We are using primus 2.4.12 with the engine.io transport and we encountered a strange issue where some clients keep getting disconnected and reconnecting about once a minute. The common factor between these clients seems to be OS X 10.10.2 and Safari 8.0.3.\r\n\r\nWhen investigating the issue we increased the server heartbeat timeout and added debug logging on the 'incoming::ping' event and noticed that the interval between heartbeats from the Safari clients is quite irregular (ping interval is set to 25 000 ms):\r\n\r\n46998 ms since last ping or connect\r\n46999 ms since last ping or connect\r\n30992 ms since last ping or connect\r\n\r\nMeanwhile a Google Chrome client will keep sending heartbeats regularly ~26 s apart. Any ideas what could be causing this and how to investigate it further? As a workaround we increased the server heartbeat timeout to 90 seconds which seems to mitigate the issue for now.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/primus/primus/issues/comments/143409157","html_url":"https://github.com/primus/primus/issues/348#issuecomment-143409157","issue_url":"https://api.github.com/repos/primus/primus/issues/348","id":143409157,"user":{"login":"lpinca","id":1443911,"avatar_url":"https://avatars.githubusercontent.com/u/1443911?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinca","html_url":"https://github.com/lpinca","followers_url":"https://api.github.com/users/lpinca/followers","following_url":"https://api.github.com/users/lpinca/following{/other_user}","gists_url":"https://api.github.com/users/lpinca/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinca/subscriptions","organizations_url":"https://api.github.com/users/lpinca/orgs","repos_url":"https://api.github.com/users/lpinca/repos","events_url":"https://api.github.com/users/lpinca/events{/privacy}","received_events_url":"https://api.github.com/users/lpinca/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T08:13:30Z","updated_at":"2015-09-26T08:13:30Z","body":"@STRML I tried adding a bogus interval to my previous test case:\r\n```js\r\n(function () {\r\n  var start = +new Date()\r\n    , count = 0;\r\n\r\n  setInterval(function () {\r\n    count++;\r\n  }, 1000);\r\n\r\n\r\n  function timeout() {\r\n    var now = +new Date();\r\n\r\n    console.log(now - start);\r\n    start = now;\r\n    setTimeout(timeout, 25000);\r\n  }\r\n\r\n  setTimeout(timeout, 25000);\r\n})();\r\n```\r\nbut I still get the same results in Safari 9.0.\r\nThe interval timer with 1000 ms delay does not affect the timeout timer which randomly gets fired after 35000 ms."}}