Skip to content
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

Make togglws reconnect to the server automatically after ~50 mins #6

Open
Brads3290 opened this issue Apr 5, 2021 · 5 comments
Open

Comments

@Brads3290
Copy link
Owner

See my quote from issue #5 :

Note that this reconnects at 1 hour exactly, after the server closes the connection. In my test, the Toggl web app reconnected at around 58 mins which suggests that Toggl places the responsibility on the client to close the connection and reconnect before the hour, so maybe we should implement additional logic to do that.

@ihoru
Copy link
Contributor

ihoru commented Apr 9, 2021

Why did you open this issue? :)

@Brads3290
Copy link
Owner Author

Sort of a to-do for myself in future. It looks like Toggl makes the assumption that the client will reconnect on a schedule (rather than only when Toggl server closes the connection), so there could be an additional risk that Toggl with make a change on their server that breaks our code.

Of course that's always a risk but I figure the more closely we mimic their web app, the less risk there is.

@ihoru
Copy link
Contributor

ihoru commented Apr 10, 2021

In this case I didn't understand what have you done in #5

@Brads3290
Copy link
Owner Author

In #5 I made it wait for the connection to be closed by the server, then automatically reconnect.

I made this issue because I want to add an extra layer of “protection” by proactively recycling the connection rather than waiting for the server to close it, because that’s how the Toggl web app works.

Hopefully that makes more sense :)

@ihoru
Copy link
Contributor

ihoru commented Apr 10, 2021

Yes, I understood now. With those changes (#5) I still got disconnected (at least once, I don't want to check any more, I just restart app every 30 minutes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants