Reassemble WebSocket fragments with one join

KL
1mo ago
+60-26

Repeatedly concatenating WebSocket fragments recopies the accumulated message for every frame. Collect the fragments and join them once when a complete text or binary message arrives in both synchronous and asynchronous sessions.

The high-level tests now cover text and binary fragmented-message reassembly through the public session APIs.

Validation

  • Full test suite: 2,090 passed, 1 skipped
  • Coverage: 100%
  • Ruff, mypy, and unasync checks passed

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.