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

Concurrency version of connect can potentially miss messages that the other client sends on connect. #156

Open
Cyberbeni opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Cyberbeni
Copy link

Cyberbeni commented Jan 29, 2025

Describe the issue

See title

Vapor version

Not using Vapor, WebSocket-kit 2.15.0

Operating system and version

alpine:latest docker container

Swift version

6.0.2 docker image with static Linux SDK

Steps to reproduce

Connect to a Home Assistant server inside an actor. (Tested with HA version 2025.1.4, running on the same machine)
When there is a new Task started inside onUpgrade (either by the wrapper in WebSocket-kit or using the connect function with futures and doing it manually) and the onText callback of the webSocket is set up inside that, the initial auth_required message from the Home Assistant server is most often not delivered.
If I use the connect function with futures and set the onText callback then I seem to receive that message every time. (Then I need to start a new task, so I can save the WebSocket to a variable, so I can use it for sending messages)

Outcome

No response

Additional notes

No response

@Cyberbeni Cyberbeni added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant