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

fix: close websocket handler when web socket is dropped #320

Merged
merged 3 commits into from
Feb 5, 2025

Conversation

boxdot
Copy link
Collaborator

@boxdot boxdot commented Feb 5, 2025

  • When QsWebSocket was dropped, the handler was still running. Now, it
    is also cancelled.
  • UserCubit considered web socket disconnect events as an error, and
    reconnected again. This is not needed since internally QsWebSocket
    automatically reconnects.

Additionally, replace the broadcast channel by mpsc one, since we have
only a single subscriber. Also remove unused public APIs.

* When `QsWebSocket` was dropped, the handler was still running. Now, it
  is also cancelled.
* `UserCubit` considered web socket disconnect events as an error, and
  reconnected again. This is not needed since internally `QsWebSocket`
  automatically reconnects.

Additionally, replace the broadcast channel by mpsc one, since we have
only a single subscriber. Also remove unused public APIs.
Copy link
Member

@kkohbrok kkohbrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@boxdot boxdot merged commit d6b1d56 into main Feb 5, 2025
14 checks passed
@boxdot boxdot deleted the dima/fix-websocket-cleanup branch February 5, 2025 18:17
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.

2 participants