From 97cbd63b1a02e92f5a0bb6a7a15965749748bb12 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 19 Sep 2019 13:40:41 +0200 Subject: [PATCH 1/3] fix(test): dns4 isnt a valid tcp multiaddr It should be resolved first License: MIT Signed-off-by: Jacob Heun --- test/compliance.spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/compliance.spec.js b/test/compliance.spec.js index b337d3f..09b334f 100644 --- a/test/compliance.spec.js +++ b/test/compliance.spec.js @@ -14,8 +14,7 @@ describe('interface-transport compliance', () => { const addrs = [ multiaddr('/ip4/127.0.0.1/tcp/9091'), multiaddr('/ip4/127.0.0.1/tcp/9092'), - multiaddr('/ip4/127.0.0.1/tcp/9093'), - multiaddr('/dns4/ipfs.io') + multiaddr('/ip4/127.0.0.1/tcp/9093') ] // Used by the dial tests to simulate a delayed connect From 2d21d73b5a0a401660d837cf1323e67eec9e31ac Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 19 Sep 2019 14:51:44 +0200 Subject: [PATCH 2/3] fix: ensure timeline.close is set on the multiaddrConn License: MIT Signed-off-by: Jacob Heun --- package.json | 4 ++-- src/socket-to-conn.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2132262..aba29a0 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "aegir": "^20.0.0", "chai": "^4.2.0", "dirty-chai": "^2.0.1", - "interface-transport": "^0.6.1", + "interface-transport": "^0.7.0", "sinon": "^7.3.1" }, "dependencies": { @@ -45,7 +45,7 @@ "debug": "^4.1.1", "err-code": "^2.0.0", "ip-address": "^6.1.0", - "mafmt": "^6.0.9", + "mafmt": "^7.0.0", "multiaddr": "^7.1.0", "stream-to-it": "^0.1.1" }, diff --git a/src/socket-to-conn.js b/src/socket-to-conn.js index 83e9a4d..c1dccaf 100644 --- a/src/socket-to-conn.js +++ b/src/socket-to-conn.js @@ -79,5 +79,14 @@ module.exports = (socket, options) => { } } + socket.once('close', () => { + // In instances where `close` was not explicitly called, + // such as an iterable stream ending, ensure we have set the close + // timeline + if (!maConn.timeline.close) { + maConn.timeline.close = Date.now() + } + }) + return maConn } From f4249f07eb1fa3b5cec8a04fe1a4b96bb5a676cc Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 19 Sep 2019 14:52:17 +0200 Subject: [PATCH 3/3] chore: add docs to gitignore They are generated and uploaded on release License: MIT Signed-off-by: Jacob Heun --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9faa8e0..9a5d409 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules package-lock.json coverage .nyc_output +docs