From d3771a530f455e4f2e9f4ef7cf47d819e80c3f77 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Tue, 15 May 2018 15:00:03 -0700 Subject: [PATCH 1/4] chore: update deps and jenkins override --- ci/Jenkinsfile | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index a7da2e54f3..6f4483fb7c 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -1,2 +1,2 @@ // Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -javascript() +javascript(['nodejs_versions': ['8.11.1','9.2.0','10.0.0']]) diff --git a/package.json b/package.json index 3acb992e7c..7705ce4f5a 100644 --- a/package.json +++ b/package.json @@ -110,10 +110,10 @@ "ipfs-block": "~0.7.1", "ipfs-block-service": "~0.14.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "~0.20.0", + "ipfs-repo": "github:ipfs/js-ipfs-repo#fix/node10", "ipfs-unixfs": "~0.1.14", "ipfs-unixfs-engine": "~0.29.0", - "ipld": "~0.17.0", + "ipld": "github:ipld/js-ipld#fix/node10", "ipld-dag-cbor": "~0.12.0", "ipld-dag-pb": "~0.14.4", "is-ipfs": "~0.3.2", From a1c3c7b29aa5bb3df7d7f7c38e8add79fe9264b2 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 17 May 2018 15:00:29 -0700 Subject: [PATCH 2/4] fix: check for repo uninitialized error --- package.json | 4 ++-- src/core/boot.js | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7705ce4f5a..1ba18d80a3 100644 --- a/package.json +++ b/package.json @@ -110,10 +110,10 @@ "ipfs-block": "~0.7.1", "ipfs-block-service": "~0.14.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "github:ipfs/js-ipfs-repo#fix/node10", + "ipfs-repo": "~0.22.0", "ipfs-unixfs": "~0.1.14", "ipfs-unixfs-engine": "~0.29.0", - "ipld": "github:ipld/js-ipld#fix/node10", + "ipld": "~0.17.1", "ipld-dag-cbor": "~0.12.0", "ipld-dag-pb": "~0.14.4", "is-ipfs": "~0.3.2", diff --git a/src/core/boot.js b/src/core/boot.js index cc7c14970e..6568c15c80 100644 --- a/src/core/boot.js +++ b/src/core/boot.js @@ -3,6 +3,7 @@ const waterfall = require('async/waterfall') const series = require('async/series') const extend = require('deep-extend') +const RepoErrors = require('ipfs-repo/src/errors') // Boot an IPFS node depending on the options set module.exports = (self) => { @@ -40,7 +41,14 @@ module.exports = (self) => { // which happens when the version file is not found // we just want to signal that no repo exist, not // fail the whole process. - // TODO: improve datastore and ipfs-repo implemenations so this error is a bit more unified + + // Use standardized errors as much as possible + if (err.code === RepoErrors.ERR_REPO_NOT_INITIALIZED) { + return cb(null, false) + } + + // TODO: As error codes continue to be standardized, this logic can be phase out; + // it is here to maintain compatability if (err.message.match(/not found/) || // indexeddb err.message.match(/ENOENT/) || // fs err.message.match(/No value/) // memory From 525101a10bf7796539c8bca1301ca92656b4deea Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Tue, 29 May 2018 19:20:17 +0200 Subject: [PATCH 3/4] fix: update ipfs-repo errors require --- package.json | 2 +- src/core/boot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1ba18d80a3..a27d11d189 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "ipfs-block": "~0.7.1", "ipfs-block-service": "~0.14.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "~0.22.0", + "ipfs-repo": "^0.22.1", "ipfs-unixfs": "~0.1.14", "ipfs-unixfs-engine": "~0.29.0", "ipld": "~0.17.1", diff --git a/src/core/boot.js b/src/core/boot.js index 6568c15c80..113c9919bf 100644 --- a/src/core/boot.js +++ b/src/core/boot.js @@ -3,7 +3,7 @@ const waterfall = require('async/waterfall') const series = require('async/series') const extend = require('deep-extend') -const RepoErrors = require('ipfs-repo/src/errors') +const RepoErrors = require('ipfs-repo').errors // Boot an IPFS node depending on the options set module.exports = (self) => { From 9f80858c9294f3d9ad2f9d81d72bd72076df59bf Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Tue, 29 May 2018 19:45:14 +0200 Subject: [PATCH 4/4] chore: update dep version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a27d11d189..5273356eb6 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "ipfs-block": "~0.7.1", "ipfs-block-service": "~0.14.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "^0.22.1", + "ipfs-repo": "~0.22.1", "ipfs-unixfs": "~0.1.14", "ipfs-unixfs-engine": "~0.29.0", "ipld": "~0.17.1",