From b2e61a30c134c64ceba275f87b5ca3dde4e94ebd Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 7 Mar 2021 22:43:31 +0100 Subject: [PATCH 1/3] feat: allow passing proxy to createRpcStream Refs: https://github.com/Level/party/pull/29 --- client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 8db3488..73303d6 100644 --- a/client.js +++ b/client.js @@ -18,8 +18,8 @@ module.exports = function (opts) { db.emit('flush') } - function connect (opts) { - return down.createRpcStream(opts, null) + function connect (opts, proxy) { + return down.createRpcStream(opts, proxy) } function isFlushed () { From 419c4bb8d60c71bce1f04f80be182329e4167b84 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 7 Mar 2021 23:05:31 +0100 Subject: [PATCH 2/3] fix: don't forward 'close' event args Refs: https://github.com/Level/party/pull/29#issuecomment-792361239 --- leveldown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leveldown.js b/leveldown.js index e65ce71..e514137 100644 --- a/leveldown.js +++ b/leveldown.js @@ -229,7 +229,7 @@ Multilevel.prototype._close = function (cb) { this._clearRequests(true) if (this._streaming) { - this._streaming.once('close', cb) + this._streaming.once('close', () => cb()) this._streaming.destroy() } else { process.nextTick(cb) From e7cfa221b0133767a0694142b4903d7619e12710 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 7 Mar 2021 23:11:02 +0100 Subject: [PATCH 3/3] fixup --- leveldown.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/leveldown.js b/leveldown.js index e514137..9ef053e 100644 --- a/leveldown.js +++ b/leveldown.js @@ -229,6 +229,8 @@ Multilevel.prototype._close = function (cb) { this._clearRequests(true) if (this._streaming) { + // _streaming: could be a socket and emit 'close' with a + // hadError argument. this._streaming.once('close', () => cb()) this._streaming.destroy() } else {