libp2p / libp2p/unified-testing

js-v1.x WebSocket dial abort to jvm-v1.2

Open
#15 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

javascript jvm
Dominant language
Shell
Stars
7
Forks
19
PR merge metrics
No merged PRs in 30d

Description

**Repos:**
- [libp2p/js-libp2p](https://github.com/libp2p/js-libp2p) v1.x (local build)
- [libp2p/jvm-libp2p](https://github.com/libp2p/jvm-libp2p) (commit `737456de5d96db030aa04c8527585af1a510898f`)

**Transport:** ws, **Secure:** noise, **Muxers:** yamux, mplex

## Summary

js-v1.x fails to dial jvm-v1.2 via WebSocket with both yamux and mplex muxers. The JVM listener starts successfully and publishes its multiaddr, but the JS dialer's connection attempt is aborted with "The operation was aborted" from the dial queue.

## Failing tests (2)

- `js-v1.x x jvm-v1.2 (ws, noise, yamux)`
- `js-v1.x x jvm-v1.2 (ws, noise, mplex)`

## Error output

```
ping test (dialer)
1) should dial and ping

0 passing (5s)
1 failing

1) ping test (dialer)
should dial and ping:
CodeError: The operation was aborted
at Job.queue.add.peerId.peerId [as fn] (file:///app/node_modules/libp2p/src/connection-manager/dial-queue.ts:266:21)
at raceSignal (file:///app/node_modules/race-signal/src/index.ts:54:12)
at Job.run (file:///app/node_modules/@libp2p/utils/src/queue/job.ts:77:22)
```

The JVM listener logs show successful startup and multiaddr publication:

```
Connection established to Redis (Jedis{Connection{DefaultJedisSocketFactory{proxy-11aa3c9b:6379}}})
Starting listener with advertisedAddress: /ip4/172.18.0.7/tcp/45984/ws/p2p/12D3KooWMPjmnpSkpRpnYjrG7z1BVpawL3EHEXYZYdZqkVss9nSz
```

## Root cause analysis

The JS dialer retrieves the JVM listener's multiaddr from Redis and attempts to dial, but the connection is aborted during the dial queue processing. The abort occurs within the `raceSignal` timeout wrapper, suggesting the connection attempt times out before completing.

Possible causes:
- WebSocket upgrade handshake incompatibility between js-libp2p and jvm-libp2p
- Noise handshake failure or muxer negotiation timeout
- jvm-libp2p's WebSocket listener may not correctly handle the JS client's connection sequence

Both muxers fail identically, indicating the failure occurs before muxer negotiation (likely during WebSocket upgrade or noise handshake).

## Notes

- The JVM listener is legacy and connects through the proxy. The JS dialer is modern and connects to global Redis. The proxy correctly translates the key names.
- No proxy hostname issues — `proxy-11aa3c9b` uses correct RFC 1123 format.
- js-v1.x successfully dials other implementations (go, rust, nim) via ws, so the issue is specific to jvm-v1.2 as listener.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two failing interoperability tests for js-v1.x and jvm-v1.2 using WebSocket, Noise, and each muxer. Trace the JS failure from connection-manager/dial-queue.ts through raceSignal, then compare the WebSocket listener and handshake behavior at the referenced JVM commit. Done means both dialer ping tests pass without the operation being aborted.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, redis
Domain
networking, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.