Skip to content

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

Closed

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.

Activity

  1. added this to the v1.0.0-alpha.1 milestone on Nov 5, 2026
  2. added 2 commits that reference this issue on Nov 8, 2026
    81d655d
    dc5342b
  3. jderochervlk commented on Nov 8, 2026

    @jderochervlk
    CollaboratorAuthor

    Fixed by #399 and now on main through #397 at 844c32af. The WebSocket overloads and worker Request fetch use receiver dispatch. Browser regressions check text, ArrayBuffer and Blob sends through a local socket; the worker test checks both default GET and POST with forwarded headers/body. SharedWorkerScope and ServiceWorkerScope remain compile-checked, with runtime coverage on the base Worker scope.

    Main CI passed the feature builds, negative consumers, Node and Chromium tests. Closing as completed. This issue stayed open because #399 originally merged into a feature branch.

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