Skip to content

Fix receiver dispatch for WebSocket sends and worker Request fetches #386

Open

Description

@jderochervlk

Part of #382 — v1.0.0 alpha readiness.

Confirmed failures

  • src/messaging/WebSocket.res:59-L74: sendArrayBuffer, sendBlob, and sendString lack @send. A compiled packed consumer emits send(socket, payload) instead of socket.send(payload) and throws ReferenceError: send is not defined.
  • src/workers/Worker.res:44-L45: fetchWithRequest lacks @send. A compiled consumer emits fetch(self, request), treating the scope as the URL. The review reproduction rejected while parsing [object global].

The adjacent DataView WebSocket overload and string Worker fetch overload already use receiver dispatch correctly.

Acceptance criteria

  • Correct receiver annotations for all three affected WebSocket overloads and the worker Request overload.
  • Check the inherited shared/service-worker scope paths as well as the base binding.
  • Add regression checks that verify the receiver, argument order, payload, and optional initializer forwarding.
  • Exercise representative text/binary sends against a local WebSocket endpoint and Request-based fetch in a real worker (local or data: fixture; no public-network dependency).
  • Existing compile/feature tests remain green.

Fix the common dispatch rule across these sibling overloads rather than patching only the string-send example.

Coordination

Use the regression infrastructure in #383. Source fixes can be developed in parallel, but this issue should close with executed regression coverage, not only a successful compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions