-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sente/reconnect doesn't reset backoff-ms attempt number when chsk is closed #167
Comments
Hey Daniel, Your understanding's correct - though the behaviour's not technically a bug. i.e. Would 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. Can try take a look at this myself at the weekend. Thanks for the report, the current behaviour's definitely surprising. |
I'll have a look tomorrow with clearer eyes, but I think this might be part of the solution (also a note to self): (reset! nattempt_ 0)
(.clearInterval js/window @kalive-timer_) |
The So we may need to add a new |
So I've taken a swing at this, and what I went with is adding the connect! fn to the record and using that directly while clearing the interval timer. This means the timer gets reset but the number of attempts doesn't (which seems desirable?). Does that sound good to you guys? |
Open a PR and we can take a look :) |
Just clean up some historical cruft to make it more obvious what's going on
Fixed in the SNAPSHOT I'm busy uploading now... |
This commit: - Signf. simplifies the retry impln. - Introduces the notion of retry-ids so that we can easily noop the effect of any pending retries just by switching out the active id. - Simplified the client API: dropped `chsk-destroy!` and added `chsk-disconnect!`. The latter is just a reversible version of the latter.
This commit: - Signf. simplifies the retry impln. - Introduces the notion of retry-ids so that we can easily noop the effect of any pending retries just by switching out the active id. - Simplified the client API: dropped `chsk-destroy!` and added `chsk-disconnect!`. The latter is just a reversible version of the latter.
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.Is this understanding correct, and is this a bug?
The text was updated successfully, but these errors were encountered: