Skip to content

Complete Babylon WebSocket lifecycle and frame fidelity #244

Description

@LocNguyenHuu

Description

Complete the WebSocket contract between Babylon and Rockxy so instrumented connections preserve frame order, direction, opcode, limits, and termination state from task creation through close or failure.

This work is specific to instrumented-client intake and complements the native proxy WebSocket lifecycle and inspector work.

Use Case

A developer should be able to inspect an instrumented WebSocket connection from its earliest queued frame through normal or abnormal termination without missing frames or seeing misleading ping, pong, or close information.

Proposed Solution

  • Align producer and receiver frame and connection limits.
  • Preserve frames queued before the upgrade response is available.
  • Model text, binary, ping, pong, and close explicitly.
  • Preserve direction, timestamp, close origin, close code, close reason, and abnormal termination.
  • Apply the current capture policy on every Babylon start/stop session.
  • Update the parent transaction exactly once while allowing the final lifecycle state to arrive.
  • Keep frame messages compact by referencing the parent handshake instead of repeating the complete transaction.

Alternatives Considered

  • Dropping pre-upgrade frames produces incomplete timelines.
  • Combining ping and pong loses direction and protocol meaning.
  • Re-encoding the parent request and response with every frame increases memory and transport cost.

Acceptance Criteria

  • Pre-upgrade queued frames are retained in order.
  • Text, binary, ping, pong, and close remain distinct.
  • Direction, close origin, code, reason, and abnormal termination are preserved.
  • Producer and receiver enforce the same documented limits.
  • Disabling WebSocket capture applies to the current session even when hooks were installed previously.
  • Parent completion is idempotent and final state is not discarded.
  • Tests cover immediate send, receive, ping, pong, normal close, remote close, abrupt failure, limits, and restart with capture disabled.

Related Public Work

Metadata

Metadata

Assignees

Labels

area/testingAutomated verification, UI tests, and workflow regression coveragearea/traffic-captureCapture lifecycle, request list, inspector, and high-volume traffic UXarea/websocketWebSocket capture, inspection, and related UXenhancementNew feature or requestmacosApplies to macOS platform behaviornetworkingProxy, capture, transport, and networking behaviorpriority/p1High-priority work with clear user or project impactprotocol-supportProtocol-specific inspection or capture supportroadmapPublic roadmap item or roadmap-tracked workstatus/plannedAccepted and planned for a future iteration

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions