ReviewOS

home-lang/home

Port Socket.IO handshake and CORS corpus

#299
Closed chris opened this 10 days ago ·
10 days ago

Bun compatibility slice

Port js/third_party/socket.io/socket.io-handshake.test.ts at exhaustive corpus position 4052.

Required behavior

  • support Engine.IO polling GET and OPTIONS handshakes on a numeric-port socket.io server;
  • emit configured CORS origin, methods, allowed headers, and credentials;
  • honor callback-based allowRequest approval and rejection;
  • provide the fixture's SuperAgent request surface without bypassing Home's HTTP stack;
  • retain causal, operation-tagged handshake diagnostics internally while returning a safe HTTP error body;
  • add focused and permanent regression coverage.

Tracked from #66.

10 days ago

Implemented and pushed in 9cedfac6f.

The port now covers:

  • numeric-port Socket.IO servers attached through Home's Node HTTP compatibility layer;
  • Engine.IO polling GET handshakes with a real open packet and registered logical session;
  • CORS preflight and GET response headers for configured origins, methods, allowed headers, and credentials;
  • callback-based allowRequest approval, rejection, thrown failures, and single-settlement behavior;
  • the required fluent SuperAgent GET/OPTIONS, query, header, and callback surface routed through Home's HTTP implementation;
  • server-side SocketIOHandshakeError diagnostics carrying code, operation, method, URL, status, cause, and causal stack;
  • sanitized client-facing HTTP failures that do not expose the server policy cause.

Verification:

  • focused position 4052: 1 file, 4 passed, 0 failed/todo/unsupported/allowed-empty;
  • Socket.IO positions 4050–4052: 3 files, 13 passed, 4 explicit todos, 0 failed/unsupported/allowed-empty;
  • permanent gRPC error-stack, SQL adapter-contract, third-party corpus, and 35-case third-party diagnostic suites all pass.

Sign in to comment on this issue.