Skip to content

node-datachannel drops messages queued behind a remote close #124

Description

@lann

The jco-node backend can lose messages a peer sent immediately before closing the channel: node-datachannel's native layer marshals each event type through its own thread-safe-function queue (no cross-queue ordering), and the remote close's marshaled callback runs a cleanup that resets the message callback — its TSFN Abort() discards message callbacks already queued but not yet dispatched (src/cpp/data-channel-wrapper.cpp: onClosed's cleanup lambda → doCleanup()). The loss is below the JS API (the raw non-polyfill API reproduces it identically), so no host-side mitigation exists; the real fix is upstream — dispatch close through the same queue as messages, or defer the cleanup until the message queue drains. Upstream tracks it as murat-dogan/node-datachannel#375 (with a failing-test PR, #374). The race is timing-dependent: it surfaces as channel-close-flush failures with jco-node as the receiver (the jco-node loopback row, and interop pairs with a jco-node answerer). Drop the manifest entry when a fixed release ships (the expected-fail's unexpected-pass tripwire enforces this).


Migrated from TODO.md item E16.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions