diff --git a/packages/transport/stream/src/index.ts b/packages/transport/stream/src/index.ts index 3c489c50a..3e110ba81 100644 --- a/packages/transport/stream/src/index.ts +++ b/packages/transport/stream/src/index.ts @@ -792,7 +792,11 @@ export abstract class DirectStream< } try { - stream = await connection.newStream(this.multicodecs); + stream = await connection.newStream(this.multicodecs, { + // TODO this property seems necessary, together with waitFor isReadable when making sure two peers are conencted before talking. + // research whether we can do without this so we can push data without beeing able to send + negotiateFully: true, + }); if (stream.protocol == null) { stream.abort(new Error("Stream was not multiplexed")); return; @@ -2015,7 +2019,7 @@ export abstract class DirectStream< try { let checkIsWritable = (pDefer: DeferredPromise) => { // Dont wait for readlable https://github.com/libp2p/js-libp2p/issues/2321 - if (/* stream.isReadable && */ stream.isWritable) { + if (stream.isReadable && stream.isWritable) { pDefer.resolve(); } };