diff --git a/package-lock.json b/package-lock.json index 622bcee..98c0537 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,9 +34,9 @@ "devDependencies": { "cross-env": "^7.0.3", "is-canonical-base64": "^1.1.1", - "scuttle-testbot": "^2.1.0", + "scuttle-testbot": "^2.2.0", "ssb-box2": "^7.4.0", - "ssb-db2": "^7.1.1", + "ssb-db2": "^8.0.0", "ssb-replicate": "^1.3.3", "standard": "^17.1.0", "tap-arc": "^0.4.0", @@ -4715,9 +4715,9 @@ } }, "node_modules/scuttle-testbot": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/scuttle-testbot/-/scuttle-testbot-2.1.0.tgz", - "integrity": "sha512-v519Xn31VZTs629fbd1Gb73W0Qu8/6qhWEq6Df2HDPVpmP+ovSXc87eVEZG1qC2vlP94DHu6kzMNmLSvrdQOTw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/scuttle-testbot/-/scuttle-testbot-2.2.0.tgz", + "integrity": "sha512-lNclR8CbRTXqbjTvlpYLZ5KiPoq7fvF7xosqCGVywTvA+OfP8dK81yAGVWDc001X8zor9hosr09Hlxo+/gbarQ==", "dev": true, "dependencies": { "color-tag": "^1.0.2", @@ -4731,6 +4731,91 @@ "ssb-keys": "^8.5.0" } }, + "node_modules/scuttle-testbot/node_modules/flumecodec": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/flumecodec/-/flumecodec-0.0.1.tgz", + "integrity": "sha512-JT0xivzdV7uTucjsLMw6JhK2e1K5TmU4fGmoQqnrJbydgY/V6+m71QoxX5ZtRR1pKoD48uhPDWWE6G5MlNoGkg==", + "dev": true, + "dependencies": { + "level-codec": "^6.2.0" + } + }, + "node_modules/scuttle-testbot/node_modules/flumecodec/node_modules/level-codec": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-6.2.0.tgz", + "integrity": "sha512-J437PvCMZZKNT88+VRh6dkmh1ndZzwGwDzb5ZZl3QEsl+U9wIlt8hG+Y1gXVOhH75gf8JyceKGiG6WFUBbxyGQ==", + "dev": true + }, + "node_modules/scuttle-testbot/node_modules/private-group-spec": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/private-group-spec/-/private-group-spec-1.2.0.tgz", + "integrity": "sha512-O7SfG+vZIZgqDXy/wjsuTRI5LaozW4rxaZBpGmwlcDfjIvxvYWNboyNm1PoQUU6j4dQ02V1tOQVLDq9u2RzolA==", + "dev": true, + "dependencies": { + "is-my-ssb-valid": "^1.2.0" + } + }, + "node_modules/scuttle-testbot/node_modules/ssb-box2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ssb-box2/-/ssb-box2-3.0.1.tgz", + "integrity": "sha512-jQhrsEyrpqnUciEb1qzqc/SJCAx3hTm48BMzMy1bE//xQthWRahigTffflOM7pdRieGlxwGlHc8PpagBBZOkhA==", + "dev": true, + "dependencies": { + "envelope-js": "^1.3.0", + "private-group-spec": "^1.2.0", + "ssb-bfe": "^3.7.0", + "ssb-keyring": "^2.2.0", + "ssb-private-group-keys": "^0.4.1", + "ssb-ref": "^2.16.0", + "ssb-uri2": "^2.4.0" + } + }, + "node_modules/scuttle-testbot/node_modules/ssb-db2": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/ssb-db2/-/ssb-db2-7.2.0.tgz", + "integrity": "sha512-XxqzmccNgE2YmUZ+lXhw08BVlLEGA8LnIXBeeem4+084/fOPdBdGbXy8rb1G3UoiKVYFLVBc64LhbRQ/JfaS6w==", + "dev": true, + "dependencies": { + "async-append-only-log": "^4.3.7", + "atomic-file-rw": "^0.3.0", + "binary-search-bounds": "^2.0.4", + "bipf": "^1.9.0", + "debug": "^4.3.1", + "fastintcompression": "0.0.4", + "flumecodec": "0.0.1", + "flumelog-offset": "3.4.4", + "hoox": "0.0.1", + "jitdb": "^7.0.0", + "level": "^6.0.1", + "level-codec": "^9.0.2", + "lodash.debounce": "^4.0.8", + "mkdirp": "^1.0.4", + "multicb": "1.2.2", + "mutexify": "^1.3.1", + "obz": "^1.1.0", + "p-defer": "^3.0.0", + "pull-cat": "^1.1.11", + "pull-drain-gently": "^1.1.0", + "pull-level": "^2.0.4", + "pull-notify": "^0.1.2", + "pull-paramap": "^1.2.2", + "pull-stream": "^3.6.14", + "push-stream": "^11.0.0", + "rimraf": "^3.0.2", + "ssb-about-self": "^1.0.1", + "ssb-box": "^1.0.0", + "ssb-box2": "^3.0.0", + "ssb-classic": "^1.1.0", + "ssb-keys": "^8.4.0", + "ssb-ref": "^2.14.3", + "ssb-uri2": "^2.2.0", + "too-hot": "^1.0.0", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/secret-handshake": { "version": "1.1.21", "resolved": "https://registry.npmjs.org/secret-handshake/-/secret-handshake-1.1.21.tgz", @@ -5313,9 +5398,9 @@ } }, "node_modules/ssb-db2": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ssb-db2/-/ssb-db2-7.1.1.tgz", - "integrity": "sha512-mRnqDY2XTTdgT0ILsWPcOWL2/WdAPlYwBEhXYm1vtnPeS2da8RcTSMIOzBAp/bAcnfJWMgUOgRNupQnbiLjMCg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ssb-db2/-/ssb-db2-8.0.0.tgz", + "integrity": "sha512-olATtBPh4cAWicdgits3XpWU4haQ5mE5/Vc2OdonlNR0AQqG8Y80ONBQ8+arTQDRYYA7YME/VKlHNphZTr3MxA==", "dev": true, "dependencies": { "async-append-only-log": "^4.3.7", @@ -5397,7 +5482,7 @@ "ssb-uri2": "^2.4.0" } }, - "node_modules/ssb-db2/node_modules/ssb-keyring": { + "node_modules/ssb-keyring": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ssb-keyring/-/ssb-keyring-2.2.0.tgz", "integrity": "sha512-pXNzYsQbtdWoWAjEPT5lVrZs/Px4ypJU2m4S34tTN6KivZukHPcflj1/IbZSDj7kHJGQhJRcyqGQ3MxgQdFBrA==", @@ -5414,7 +5499,16 @@ "ssb-uri2": "^2.4.0" } }, - "node_modules/ssb-db2/node_modules/ssb-keyring/node_modules/ssb-private-group-keys": { + "node_modules/ssb-keyring/node_modules/private-group-spec": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/private-group-spec/-/private-group-spec-1.2.0.tgz", + "integrity": "sha512-O7SfG+vZIZgqDXy/wjsuTRI5LaozW4rxaZBpGmwlcDfjIvxvYWNboyNm1PoQUU6j4dQ02V1tOQVLDq9u2RzolA==", + "dev": true, + "dependencies": { + "is-my-ssb-valid": "^1.2.0" + } + }, + "node_modules/ssb-keyring/node_modules/ssb-private-group-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/ssb-private-group-keys/-/ssb-private-group-keys-1.1.2.tgz", "integrity": "sha512-0UPPmxy61qmbDmP71J2vhX6UPfCtXa/CNehxYTgk2+AaLXsnA0perGZAiOWm9niGEU50TYYC5/jsIfjz4IiD9A==", diff --git a/package.json b/package.json index 7ba1b2c..8879f4d 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,9 @@ "devDependencies": { "cross-env": "^7.0.3", "is-canonical-base64": "^1.1.1", - "scuttle-testbot": "^2.1.0", + "scuttle-testbot": "^2.2.0", "ssb-box2": "^7.4.0", - "ssb-db2": "^7.1.1", + "ssb-db2": "^8.0.0", "ssb-replicate": "^1.3.3", "standard": "^17.1.0", "tap-arc": "^0.4.0", diff --git a/test/helpers/test-bot.js b/test/helpers/test-bot.js index 7db2d4f..eec8f11 100644 --- a/test/helpers/test-bot.js +++ b/test/helpers/test-bot.js @@ -18,7 +18,7 @@ module.exports = function TestBot (opts = {}) { .use(require('ssb-classic')) .use(require('ssb-db2/compat')) .use(require('ssb-db2/compat/feedstate')) - // .use(require("ssb-db2/compat/publish")) + .use(require("ssb-db2/compat/post")) .use(require('ssb-box2')) .use(require('../..')) // ssb-tribes - NOTE load it after ssb-backlinks @@ -33,8 +33,8 @@ module.exports = function TestBot (opts = {}) { legacyMode: true, ...opts.box2 }, - // we don't want testbot to import db2 for us, we want more granularity and control of dep versions - db1: true, + // we don't want testbot to import db1 or db2 for us, we want to control what db2 plugins get imported + noDefaultUse: true, ...opts }) diff --git a/test/rebuild.test.js b/test/rebuild.test.js index 38b2da6..68fd2dc 100644 --- a/test/rebuild.test.js +++ b/test/rebuild.test.js @@ -34,8 +34,6 @@ test('rebuild (I am added to a group)', async t => { // time for rebuilding await p(setTimeout)(500) - t.true(me.status().sync.sync, 'all indexes updated') - const msgs = await pull( me.db.query( where(and( @@ -243,12 +241,6 @@ test('rebuild from listen.addMember', t => { // NOTE with auto-rebuild active, this listener gets hit twice: // 1. first time we see group/add-member (unboxed with DM key) // 2. after rebuild - function checkRebuildDone (done) { - if (A.status().sync.sync) return done() - - console.log('waiting for rebuild') - setTimeout(() => checkRebuildDone(done), 500) - } pull( listen.addMember(A), pull.filter(m => !m.sync), @@ -259,12 +251,12 @@ test('rebuild from listen.addMember', t => { // (2) B invites A if (heardCount === 2) { - checkRebuildDone(() => { + setTimeout(() => { A.close(err => { t.error(err, 'A closed') t.end() }) - }) + }, 500) } }) )