fix(hub): synchronise WebSocket connection access (#2453)

Co-authored-by: user01010111 <lapses.50.booster@icloud.com>
This commit is contained in:
user01010111
2026-09-29 12:12:00 +13:00
committed by GitHub
parent 09a277f074
commit 921ded1af0
3 changed files with 81 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ func TestNewWsConnection(t *testing.T) {
wsConn := NewWsConnection(nil, semver.MustParse("0.12.10"))
assert.NotNil(t, wsConn, "WebSocket connection should not be nil")
assert.Nil(t, wsConn.conn, "Connection should be nil as passed")
assert.Nil(t, wsConn.conn.Load(), "Connection should be nil as passed")
assert.NotNil(t, wsConn.requestManager, "Request manager should be initialized")
assert.NotNil(t, wsConn.DownChan, "Down channel should be initialized")
assert.Equal(t, 1, cap(wsConn.DownChan), "Down channel should have capacity of 1")