{"action":"created","issue":{"url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/772","repository_url":"https://api.github.com/repos/deepstreamIO/deepstream.io","labels_url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/772/labels{/name}","comments_url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/772/comments","events_url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/772/events","html_url":"https://github.com/deepstreamIO/deepstream.io/issues/772","id":247040104,"number":772,"title":"Bug: reconnection problems on mobile","user":{"login":"daviderenger","id":18427393,"avatar_url":"https://avatars2.githubusercontent.com/u/18427393?v=4","gravatar_id":"","url":"https://api.github.com/users/daviderenger","html_url":"https://github.com/daviderenger","followers_url":"https://api.github.com/users/daviderenger/followers","following_url":"https://api.github.com/users/daviderenger/following{/other_user}","gists_url":"https://api.github.com/users/daviderenger/gists{/gist_id}","starred_url":"https://api.github.com/users/daviderenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daviderenger/subscriptions","organizations_url":"https://api.github.com/users/daviderenger/orgs","repos_url":"https://api.github.com/users/daviderenger/repos","events_url":"https://api.github.com/users/daviderenger/events{/privacy}","received_events_url":"https://api.github.com/users/daviderenger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-01T11:35:26Z","updated_at":"2017-08-13T11:53:59Z","closed_at":null,"body":"This is a long-shot, we don't know where this error lives; nginx, cloudflare or deepstream but we experience that it started to show up after upgrading to deepstream 2.x.\r\n\r\nSo after waking up our mobile app after a period of sleep longer than heartbeat interval it will try to reestablish the websocket connection. Often it doesn't take any time at all and all is fine but sometimes, pretty often it takes up to 30 seconds before it succeeds. This happens on both Android and iOS (both relying on deepstream-client-js) So we don't think it is frontend related. The error we see looks like this:\r\n\r\n  {\r\n    \"timestamp\": 1501003753273,\r\n    \"error\": \"heartbeat not received in the last 20000 milliseconds\",\r\n    \"event\": \"connectionError\",\r\n    \"topic\": \"C\"\r\n  },\r\n  {\r\n    \"timestamp\": 1501003754312,\r\n    \"error\": \"\"{\"isTrusted\":true}\",\r\n    \"event\": \"connectionError\",\r\n    \"topic\": \"C\"\r\n  },\r\n  {\r\n    \"timestamp\": 1501003755345,\r\n    \"error\": \"{\"isTrusted\":true}\",\r\n    \"event\": \"connectionError\",\r\n    \"topic\": \"C\"\r\n  },\r\n  {\r\n    \"timestamp\": 1501003755834,\r\n    \"error\": \"{\"isTrusted\":true}\",\r\n    \"event\": \"connectionError\",\r\n    \"topic\": \"C\"\r\n  },\r\n\r\n  ...... goes on until it succeeds and then a lot of these:\r\n\r\n  {\r\n    \"timestamp\": 1501003801150,\r\n    \"error\": \"emailAccount/xxxxx\",\r\n    \"event\": \"MULTIPLE_SUBSCRIPTIONS\",\r\n    \"topic\": \"R\"\r\n  },\r\n  {\r\n    \"timestamp\": 1501003801164,\r\n    \"error\": \"emailAccount/xxxxx\",\r\n    \"event\": \"MULTIPLE_SUBSCRIPTIONS\",\r\n    \"topic\": \"R\"\r\n  },\r\n  {\r\n    \"timestamp\": 1501003801188,\r\n    \"error\": \"role/xxxx\",\r\n    \"event\": \"MULTIPLE_SUBSCRIPTIONS\",\r\n    \"topic\": \"R\"\r\n  },\r\n\r\n  ... etc\r\n\r\n\r\nIts always when reconnecting, never on a fresh start.\r\n\r\nI have experimented with reconnection intervals, heartbeat intervals and all that but found nothing. Also one user has reported this on his desktop client bu we have never been able to replicate that.\r\n\r\nI have also tried with different networks, wifi, really slow mobile data etc but it doesn't seem to make any difference either\r\n\r\n  clientOptions: {\r\n    maxReconnectAttempts: Infinity,\r\n    reconnectIntervalIncrement: 1500,\r\n    rpcAckTimeout: 20000,\r\n    rpcResponseTimeout: 20000,\r\n    subscriptionTimeout: 20000,\r\n    recordReadAckTimeout: 20000,\r\n    recordReadTimeout: 20000,\r\n    recordDeleteTimeout: 20000,\r\n    heartbeatInterval: 10000,\r\n    maxReconnectInterval: 5000\r\n  }\r\n\r\nAnyone else experience symptoms like these?"},"comment":{"url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/comments/322037601","html_url":"https://github.com/deepstreamIO/deepstream.io/issues/772#issuecomment-322037601","issue_url":"https://api.github.com/repos/deepstreamIO/deepstream.io/issues/772","id":322037601,"user":{"login":"yasserf","id":2734923,"avatar_url":"https://avatars0.githubusercontent.com/u/2734923?v=4","gravatar_id":"","url":"https://api.github.com/users/yasserf","html_url":"https://github.com/yasserf","followers_url":"https://api.github.com/users/yasserf/followers","following_url":"https://api.github.com/users/yasserf/following{/other_user}","gists_url":"https://api.github.com/users/yasserf/gists{/gist_id}","starred_url":"https://api.github.com/users/yasserf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yasserf/subscriptions","organizations_url":"https://api.github.com/users/yasserf/orgs","repos_url":"https://api.github.com/users/yasserf/repos","events_url":"https://api.github.com/users/yasserf/events{/privacy}","received_events_url":"https://api.github.com/users/yasserf/received_events","type":"User","site_admin":false},"created_at":"2017-08-13T11:53:59Z","updated_at":"2017-08-13T11:53:59Z","body":"> So after waking up our mobile app after a period of sleep longer than heartbeat interval it will try to reestablish the websocket connection. Often it doesn't take any time at all and all is fine but sometimes, pretty often it takes up to 30 seconds before it succeeds. \r\n\r\nIs there a possibility you need the same hook we have in java, where you can inform the client to go into network_disconnected mode and then reconnected again when resumed?"}}
{"actor":{"display_login":"yasserf"}}