Implement client WebSocket.bufferedAmount#31761
Open
robobun wants to merge 13 commits into
Open
Claude / Claude Code Review
completed
Jun 3, 2026 in 20m 17s
Code review found 1 potential issue
Found 3 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/jsc/bindings/webcore/WebSocket.cpp:1223-1241 |
bufferedAmount resets to 0 after close() instead of retaining backlog |
Annotations
Check warning on line 1241 in src/jsc/bindings/webcore/WebSocket.cpp
claude / Claude Code Review
bufferedAmount resets to 0 after close() instead of retaining backlog
After `ws.close()` (or `terminate()`), `bufferedAmount` drops back to 0 even if a large backlog was queued, because `m_connectedWebSocketKind` is set to `None` and the fallback `m_bufferedAmount` is always 0 (its only writer, `WebSocket__didClose`, hardcodes `0` for `unhandledBufferedAmount`). The WHATWG spec says the number must not reset once the connection closes; consider snapshotting `getBufferedAmount` into `m_bufferedAmount` in `close()`/`terminate()` just before clearing `m_connectedWebS
Loading