{"action":"created","issue":{"url":"https://api.github.com/repos/ptaoussanis/sente/issues/167","labels_url":"https://api.github.com/repos/ptaoussanis/sente/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/ptaoussanis/sente/issues/167/comments","events_url":"https://api.github.com/repos/ptaoussanis/sente/issues/167/events","html_url":"https://github.com/ptaoussanis/sente/issues/167","id":108856602,"number":167,"title":"sente/reconnect doesn't reset backoff-ms attempt number when chsk is closed","user":{"login":"danielcompton","id":811954,"avatar_url":"https://avatars.githubusercontent.com/u/811954?v=3","gravatar_id":"","url":"https://api.github.com/users/danielcompton","html_url":"https://github.com/danielcompton","followers_url":"https://api.github.com/users/danielcompton/followers","following_url":"https://api.github.com/users/danielcompton/following{/other_user}","gists_url":"https://api.github.com/users/danielcompton/gists{/gist_id}","starred_url":"https://api.github.com/users/danielcompton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielcompton/subscriptions","organizations_url":"https://api.github.com/users/danielcompton/orgs","repos_url":"https://api.github.com/users/danielcompton/repos","events_url":"https://api.github.com/users/danielcompton/events{/privacy}","received_events_url":"https://api.github.com/users/danielcompton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-29T12:12:48Z","updated_at":"2015-09-29T12:27:06Z","closed_at":null,"body":"From my testing, it seems like when calling `sente/reconnect` from a closed chsk, the backoff-ms attempt number isn't reset. The use case for this is displaying to the user the number of seconds before reconnecting, but giving them the option to reconnect faster if they want to. Currently, they can click a reconnect button, but if the channel socket is closed then nothing will happen, and Sente will try to reconnect on it's normal schedule.\r\n\r\nIs this understanding correct, and is this a bug?"},"comment":{"url":"https://api.github.com/repos/ptaoussanis/sente/issues/comments/144044241","html_url":"https://github.com/ptaoussanis/sente/issues/167#issuecomment-144044241","issue_url":"https://api.github.com/repos/ptaoussanis/sente/issues/167","id":144044241,"user":{"login":"ptaoussanis","id":160011,"avatar_url":"https://avatars.githubusercontent.com/u/160011?v=3","gravatar_id":"","url":"https://api.github.com/users/ptaoussanis","html_url":"https://github.com/ptaoussanis","followers_url":"https://api.github.com/users/ptaoussanis/followers","following_url":"https://api.github.com/users/ptaoussanis/following{/other_user}","gists_url":"https://api.github.com/users/ptaoussanis/gists{/gist_id}","starred_url":"https://api.github.com/users/ptaoussanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptaoussanis/subscriptions","organizations_url":"https://api.github.com/users/ptaoussanis/orgs","repos_url":"https://api.github.com/users/ptaoussanis/repos","events_url":"https://api.github.com/users/ptaoussanis/events{/privacy}","received_events_url":"https://api.github.com/users/ptaoussanis/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T12:27:06Z","updated_at":"2015-09-29T12:27:06Z","body":"Hey Daniel,\r\n\r\nYour understanding's correct - though the behaviour's not _technically_ a bug. `chsk-reconnect!`'s currently documented as: \"Drops connection, allows auto-reconnect. Useful for reauthenticating after login/logout.\"\r\n\r\ni.e. `chsk-reconnect!` was originally added as a quick hack as a way of dropping an existing connection to allow it to come back up. Didn't have in mind to allow it to speed up reconnect attempts of already-dropped connections, though that's a totally reasonable expectation from the name.\r\n\r\nWould be happy for a PR to adopt the behaviour you're describing (+ update the docstring). Might not be an obvious/easy way to do this btw, so feel free to leave this to me if it's looking like it might be tricky.\r\n\r\nCan try take a look at this myself at the weekend. Thanks for the report btw, the current behaviour's definitely surprising."}}