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

Ensure all exceptions are retried. #71

Conversation

brian-superlist
Copy link
Contributor

@brian-superlist brian-superlist commented Mar 6, 2024

Fixes #70.

This PR ensures that if non-PhoenixException exceptions are raised when attempting to send the heartbeat, the socket will attempt to reconnect. This should fix one case where the socket is left in a "broken" state, where it stops scheduling reconnects and cannot be connected to manually.

As part of this PR, I also renamed any tests that were hitting a real backend as an _integration_test, since it is a true integration test against a backend, not a unit test that can rely on mocks. I can also go the other way, calling the new socket test a socket_unit_test.dart if that's preferred. I don't feel strongly, but I think it's important not to mix the two tests, as the integration tests are run on CI but harder to run locally.

@brian-superlist brian-superlist force-pushed the bugfix/70-handle-unexpected-exceptions branch from b7e4ae0 to 0723f34 Compare March 6, 2024 15:01
@brian-superlist brian-superlist force-pushed the bugfix/70-handle-unexpected-exceptions branch 4 times, most recently from 28ac05e to 9d39171 Compare March 6, 2024 15:40
@brian-superlist brian-superlist force-pushed the bugfix/70-handle-unexpected-exceptions branch from 9d39171 to b443909 Compare March 6, 2024 15:47
lib/src/socket.dart Outdated Show resolved Hide resolved
@matehat
Copy link
Member

matehat commented Mar 27, 2024

Thanks! It's part of the just released 0.7.1 🚀

@matehat matehat merged commit 7cf64c7 into braverhealth:master Mar 27, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

Catch all unexpected exceptions
4 participants