Commit ba94ff1
* ci: add workflow to auto-add issues to project board
Automatically adds newly opened issues to the EVStack Evolve
project board (orgs/evstack/projects/7).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* swarm: add WebSocket endpoint registration and message type handling tests (#20)
Critical fix: RegisterRPCFuncs does not register a WebSocket endpoint.
ev-abci was missing /websocket — clients could not connect via WebSocket at
all. Fix adds an explicit WebsocketManager registration in startRPC.
Documentation added to startRPC explaining RFC 6455 §11.8 message type
handling as delegated to CometBFT's wsConnection (gorilla/websocket).
New pkg/rpc/server_test.go with 7 integration tests:
- TestWebSocket_TextValidJSON: health request over WS returns success
- TestWebSocket_TextInvalidJSON: malformed JSON yields parse error (-32700)
- TestWebSocket_BinaryFrame: binary frames yield parse error, not crash
- TestWebSocket_CloseFrame: normal close (1000) closes connection cleanly
- TestWebSocket_PingPong: server-initiated pings received within timeout
- TestWebSocket_LargeMessage: exceeding read limit yields CloseMessageTooBig
- TestRPCServer_WebSocketEndpointRegistered: end-to-end /websocket works
Note: client-initiated ping test uses server-initiated pings instead to
avoid a pre-existing data race in CometBFT's ws_handler.go (writeRoutine
sets SetPingHandler concurrent with readRoutine's first advanceFrame call).
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* swarm: fix LargeMessage test assertion for close code specificity (#20)
IsUnexpectedCloseError(err, 1009) returns true when the code is NOT
1009, so the OR with IsCloseError made the assertion pass for any close
frame. Replace with IsCloseError(err, CloseMessageTooBig) alone to
enforce the specific code 1009.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* build: promote gorilla/websocket to direct dependency
go mod tidy moves gorilla/websocket from indirect to direct now that
the WebSocket test code imports it explicitly.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: wire OnDisconnect and ReadLimit into WebSocket manager
Without OnDisconnect, disconnected WebSocket clients leave dangling
subscriptions on the EventBus. Pass the EventBus to RPCServer so the
WebSocket manager can call UnsubscribeAll on disconnect, matching
CometBFT's node.go pattern. Also set ReadLimit from RPC config.
Closes #18
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* test: add OnDisconnect subscription cleanup test
Verify that when a WebSocket client subscribes to events and then
disconnects, the OnDisconnect callback fires and removes all
subscriptions for that client from the EventBus.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---------
Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent c1388c3 commit ba94ff1
4 files changed
Lines changed: 419 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
30 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
48 | 70 | | |
49 | 71 | | |
50 | 72 | | |
| |||
64 | 86 | | |
65 | 87 | | |
66 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
67 | 106 | | |
68 | 107 | | |
69 | 108 | | |
| |||
0 commit comments