From 967dc2cf753ca69bf7170215ae27a081ae8dd9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Ribo=CC=81?= Date: Sat, 15 Jun 2024 03:27:27 +0200 Subject: [PATCH] =?UTF-8?q?fix:level=20db=20testing=20Signed-off-by:=20Fra?= =?UTF-8?q?ncisco=20Javier=20Rib=C3=B3=20Labrador=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- packages/indexdb/tests/setup.ts | 10 ++ packages/inmemory/package.json | 2 +- packages/inmemory/tests/setup.ts | 1 + packages/leveldb/package.json | 6 +- packages/leveldb/src/leveldb/instance.ts | 141 ++++++++++++++-------- packages/leveldb/src/leveldb/internal.ts | 90 +++++++++----- packages/leveldb/tests/setup.ts | 1 + packages/leveldb/vitest.config.ts | 1 - packages/test-suite/src/helper/index.ts | 4 +- packages/test-suite/src/helper/schemas.ts | 2 +- packages/test-suite/src/index.ts | 60 ++++----- 12 files changed, 198 insertions(+), 122 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ae2e9f46..8695857c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -61,7 +61,7 @@ }, { "command": "npm run test", - "cwd": "${workspaceFolder}/packages/indexdb", + "cwd": "${workspaceFolder}/packages/leveldb", "name": "TEST", "request": "launch", "type": "node-terminal", diff --git a/packages/indexdb/tests/setup.ts b/packages/indexdb/tests/setup.ts index 77680709..1361d2a6 100644 --- a/packages/indexdb/tests/setup.ts +++ b/packages/indexdb/tests/setup.ts @@ -1,9 +1,19 @@ import "fake-indexeddb/auto"; +import { TextEncoder, TextDecoder } from "util"; + import { addRxPlugin } from "rxdb"; import { RxDBDevModePlugin } from "rxdb/plugins/dev-mode"; +import nodeCrypto from "crypto"; if (process.env.NODE_ENV === "debug") { addRxPlugin(RxDBDevModePlugin); } +Object.defineProperty(globalThis, "crypto", { + value: { + getRandomValues: (arr) => nodeCrypto.getRandomValues(arr), + subtle: nodeCrypto.subtle + }, +}); +Object.assign(global, { TextDecoder, TextEncoder }); diff --git a/packages/inmemory/package.json b/packages/inmemory/package.json index 44225a01..513bbdd6 100644 --- a/packages/inmemory/package.json +++ b/packages/inmemory/package.json @@ -19,7 +19,7 @@ "clean-packages": "rm -rf node_modules && rm -rf build", "build": "rm -rf build && npx rollup -c rollup/rollup.mjs", "coverage": "npx vitest run --coverage && npx istanbul-badges-readme", - "testw": "NODE_ENV=debug vitest --run tests/*.test.ts", + "test": "NODE_ENV=debug vitest --run tests/*.test.ts", "test:watch": "NODE_ENV=debug vitest tests/*.test.ts", "test:debug": "NODE_ENV=debug vitest tests/*.test.ts --inspect-brk --pool threads --poolOptions.threads.singleThread" }, diff --git a/packages/inmemory/tests/setup.ts b/packages/inmemory/tests/setup.ts index a6df6e1b..164f4a39 100644 --- a/packages/inmemory/tests/setup.ts +++ b/packages/inmemory/tests/setup.ts @@ -11,6 +11,7 @@ if (process.env.NODE_ENV === "debug") { Object.defineProperty(globalThis, "crypto", { value: { getRandomValues: (arr) => nodeCrypto.getRandomValues(arr), + subtle: nodeCrypto.subtle }, }); diff --git a/packages/leveldb/package.json b/packages/leveldb/package.json index 4c2dd96d..c8209611 100644 --- a/packages/leveldb/package.json +++ b/packages/leveldb/package.json @@ -19,9 +19,9 @@ "prepublishOnly": "npm run build", "clean-packages": "rm -rf node_modules && rm -rf build", "build": "rm -rf build && npx rollup -c rollup/rollup.mjs", - "coverage": "npx vitest run --coverage && npx istanbul-badges-readme", - "test2": "NODE_ENV=debug vitest --run tests/*.test.ts", - "test:watch": "NODE_ENV=debug vitest tests/*.test.ts", + "coverage": "npx vitest run --coverage --pool threads --poolOptions.threads.singleThread", + "test": "NODE_ENV=debug vitest --run tests/*.test.ts --pool threads --poolOptions.threads.singleThread", + "test:watch": "NODE_ENV=debug vitest tests/*.test.ts --pool threads --poolOptions.threads.singleThread", "test:debug": "NODE_ENV=debug vitest tests/*.test.ts --inspect-brk --pool threads --poolOptions.threads.singleThread" }, "repository": { diff --git a/packages/leveldb/src/leveldb/instance.ts b/packages/leveldb/src/leveldb/instance.ts index 514204ac..3205e8a3 100644 --- a/packages/leveldb/src/leveldb/instance.ts +++ b/packages/leveldb/src/leveldb/instance.ts @@ -26,6 +26,8 @@ import { getPrimaryFieldOfPrimaryKey, getQueryMatcher, getSortComparator, + getStartIndexStringFromLowerBound, + getStartIndexStringFromUpperBound, now, } from 'rxdb' @@ -38,7 +40,11 @@ import type { LevelDBSettings, RxStorageLevelDBType, } from './types' -import { fixTxPipe } from '@pluto-encrypted/shared' +import { boundGE, boundGT, boundLE, boundLT, compareDocsWithIndex } from '@pluto-encrypted/shared' + +export function getIndexName(index: string[]): string { + return index.join(','); +} export class RxStorageIntanceLevelDB implements RxStorageInstance< RxDocType, @@ -145,65 +151,94 @@ export class RxStorageIntanceLevelDB implements RxStorageInstance< } async query(preparedQuery: PreparedQuery): Promise> { - const { queryPlan, query } = preparedQuery - const selector = query.selector - const selectorKeys = Object.keys(selector) - const skip = query.skip ? query.skip : 0 - const limit = query.limit ? query.limit : Infinity - const skipPlusLimit = skip + limit - const queryMatcher: QueryMatcher> = getQueryMatcher( + const queryPlan = preparedQuery.queryPlan; + const query = preparedQuery.query; + + const skip = query.skip ? query.skip : 0; + const limit = query.limit ? query.limit : Infinity; + const skipPlusLimit = skip + limit; + + let queryMatcher: QueryMatcher> | false = false; + if (!queryPlan.selectorSatisfiedByIndex) { + queryMatcher = getQueryMatcher( + this.schema, + preparedQuery.query + ); + } + + const queryPlanFields: string[] = queryPlan.index; + const mustManuallyResort = !queryPlan.sortSatisfiedByIndex; + const index: string[] | undefined = queryPlanFields; + const lowerBound: any[] = queryPlan.startKeys; + const lowerBoundString = getStartIndexStringFromLowerBound( this.schema, - query - ) + index, + lowerBound + ); - const queryPlanFields: string[] = queryPlan.index - const indexes: string[] = [] - if (queryPlanFields.length === 1) { - indexes.push(fixTxPipe(queryPlanFields[0]!)) - } else { - indexes.push(...queryPlanFields.map(field => fixTxPipe(field))) - } + let upperBound: any[] = queryPlan.endKeys; - const shouldAddCompoundIndexes = this.schema.indexes?.find((index) => { - if (typeof index === 'string') { - return indexes.find((index2) => index2 === index) - } else { - return index.find((subIndex) => { - return subIndex === index.find((indexValue) => indexValue === subIndex) - }) + const upperBoundString = getStartIndexStringFromUpperBound( + this.schema, + index, + upperBound + ); + const indexName = getIndexName(index); + const docsWithIndex = await this.internals.getIndex(indexName) + + let indexOfLower = (queryPlan.inclusiveStart ? boundGE : boundGT)( + docsWithIndex, + { + indexString: lowerBoundString + } as any, + compareDocsWithIndex + ); + + const indexOfUpper = (queryPlan.inclusiveEnd ? boundLE : boundLT)( + docsWithIndex, + { + indexString: upperBoundString + } as any, + compareDocsWithIndex + ); + + + let rows: RxDocumentData[] = []; + let done = false; + while (!done) { + const currentRow = docsWithIndex[indexOfLower]; + if ( + !currentRow || + indexOfLower > indexOfUpper + ) { + break; } - }) - if (shouldAddCompoundIndexes) { - indexes.splice(0, indexes.length) - indexes.push(this.collectionName) - if (typeof shouldAddCompoundIndexes === 'string') { - indexes.push(shouldAddCompoundIndexes) - } else { - indexes.push(...shouldAddCompoundIndexes) + const [currentDoc] = await this.findDocumentsById([currentRow], false) + + if (currentDoc && (!queryMatcher || queryMatcher(currentDoc))) { + rows.push(currentDoc); } - } else { - indexes.unshift(this.collectionName) - } - const indexName: string = `[${indexes.join('+')}]` - const docsWithIndex = await this.internals.getIndex(indexName) - const documents: Array> = await this.internals.bulkGet(docsWithIndex) - let filteredDocuments = documents.filter((document) => { - if (selectorKeys.length <= 0) { - return true - } else { - return queryMatcher(document) + if ( + (rows.length >= skipPlusLimit && !mustManuallyResort) + ) { + done = true; } - }) - const sortComparator = getSortComparator(this.schema, preparedQuery.query) - filteredDocuments = filteredDocuments.sort(sortComparator) + indexOfLower++; + } - filteredDocuments = filteredDocuments.slice(skip, skipPlusLimit) - return { - documents: filteredDocuments + if (mustManuallyResort) { + const sortComparator = getSortComparator(this.schema, preparedQuery.query); + rows = rows.sort(sortComparator); } + + // apply skip and limit boundaries. + rows = rows.slice(skip, skipPlusLimit); + return Promise.resolve({ + documents: rows + }); } async count(preparedQuery: PreparedQuery): Promise { @@ -244,7 +279,9 @@ export class RxStorageIntanceLevelDB implements RxStorageInstance< } async remove(): Promise { - await Promise.resolve() + this.internals.removed = true; + this.internals.clear(); + await this.close(); } conflictResultionTasks(): Observable> { @@ -306,7 +343,7 @@ export class RxStorageIntanceLevelDB implements RxStorageInstance< // const writeRow = bulkInsertDocs[i]! // const docId = writeRow.document[primaryPath] // await this.internals.bulkPut([writeRow.document], this.collectionName, this.schema) -// ret.success.push(writeRow.document) +// ret.success[docId as any] = writeRow.document // } // const bulkUpdateDocs = categorized.bulkUpdateDocs @@ -314,7 +351,7 @@ export class RxStorageIntanceLevelDB implements RxStorageInstance< // const writeRow = bulkUpdateDocs[i]! // const docId = writeRow.document[primaryPath] // await this.internals.bulkPut([writeRow.document], this.collectionName, this.schema) -// ret.success.push(writeRow.document) +// ret.success[docId as any] = writeRow.document // } // if (categorized.eventBulk.events.length > 0) { diff --git a/packages/leveldb/src/leveldb/internal.ts b/packages/leveldb/src/leveldb/internal.ts index fa00d318..92c76680 100644 --- a/packages/leveldb/src/leveldb/internal.ts +++ b/packages/leveldb/src/leveldb/internal.ts @@ -44,7 +44,7 @@ export class LevelDBInternal implements LevelDBStorageInternals !Array.isArray(row.value)), + pull.filter(row => row && !Array.isArray(row.value)), pull.map(row => { docsInDbMap.set(row.key, row.value) return row @@ -163,40 +163,76 @@ export class LevelDBInternal implements LevelDBStorageInternals((resolve, reject) => { + db.clear({}, (err) => { + if (err) { + return reject(err) + } + return resolve() + }) + }) } async close() { - return this.db.close() + const db = await this.getInstance(); + return new Promise((resolve, reject) => { + db.close((err) => { + if (err) { + return reject(err) + } + return resolve() + }) + }) + } + + private getField(item: RxDocumentData, fieldName: string) { + const splitFieldName = fieldName.split("."); + let value + while (splitFieldName.length) { + const [name] = splitFieldName.splice(0, 1); + if (name && item[name] !== undefined) { + value = item[name] + } else if (name && value && value[name] !== undefined) { + value = value[name] + } + } + return value; + } + + private encapsulateIndex(item: RxDocumentData, collectionName: string, requiredIndexes: string[]) { + return `[${collectionName}+${requiredIndexes.map((fieldName) => this.getField(item, fieldName)).join("+")}]` } async bulkPut(items: Array>, collectionName: string, schema: Readonly>>) { - const primaryKeyKey = typeof schema.primaryKey === 'string' ? schema.primaryKey : schema.primaryKey.key - const saferIndexList = safeIndexList(schema) - - for (const item of items) { - const shouldDelete = item._deleted - const id = getPrivateKeyValue(item, schema) - if (shouldDelete) { - for (const requiredIndexes of saferIndexList) { - const requiredIndex = `[${collectionName}+${requiredIndexes.join('+')}]` - await this.removeFromIndex(requiredIndex, id) - } - await this.removeFromIndex(`[${collectionName}+${primaryKeyKey}]`, id) - await this.removeFromIndex('[all]', id) - await this.delete(id) - this.documents.delete(id) - } else { - for (const requiredIndexes of saferIndexList) { - const requiredIndex = `[${collectionName}+${requiredIndexes.join('+')}]` - await this.updateIndex(requiredIndex, id) + try { + const primaryKeyKey = typeof schema.primaryKey === 'string' ? schema.primaryKey : schema.primaryKey.key + const saferIndexList = safeIndexList(schema) + for (const item of items) { + const shouldDelete = item._deleted + const id = getPrivateKeyValue(item, schema) + if (shouldDelete) { + for (const requiredIndexes of saferIndexList) { + const requiredIndex = this.encapsulateIndex(item, collectionName, requiredIndexes) + await this.removeFromIndex(requiredIndex, id) + } + await this.removeFromIndex(`[${collectionName}+${primaryKeyKey}]`, id) + await this.removeFromIndex('[all]', id) + await this.delete(id) + this.documents.delete(id) + } else { + for (const requiredIndexes of saferIndexList) { + const requiredIndex = this.encapsulateIndex(item, collectionName, requiredIndexes) + await this.updateIndex(requiredIndex, id) + } + await this.updateIndex(`[${collectionName}+${primaryKeyKey}]`, id) + await this.updateIndex('[all]', id) + await this.set(id, item) + this.documents.set(id, item) } - await this.updateIndex(`[${collectionName}+${primaryKeyKey}]`, id) - await this.updateIndex('[all]', id) - await this.set(id, item) - this.documents.set(id, item) } + } catch (err) { + console.log(err); } } } diff --git a/packages/leveldb/tests/setup.ts b/packages/leveldb/tests/setup.ts index a6df6e1b..164f4a39 100644 --- a/packages/leveldb/tests/setup.ts +++ b/packages/leveldb/tests/setup.ts @@ -11,6 +11,7 @@ if (process.env.NODE_ENV === "debug") { Object.defineProperty(globalThis, "crypto", { value: { getRandomValues: (arr) => nodeCrypto.getRandomValues(arr), + subtle: nodeCrypto.subtle }, }); diff --git a/packages/leveldb/vitest.config.ts b/packages/leveldb/vitest.config.ts index d3302639..3165e688 100644 --- a/packages/leveldb/vitest.config.ts +++ b/packages/leveldb/vitest.config.ts @@ -23,6 +23,5 @@ export default defineConfig({ 'src/**/*', ], }, - } }) diff --git a/packages/test-suite/src/helper/index.ts b/packages/test-suite/src/helper/index.ts index c9c7e214..e6353bfe 100644 --- a/packages/test-suite/src/helper/index.ts +++ b/packages/test-suite/src/helper/index.ts @@ -252,7 +252,7 @@ export function testCorrectQueries( afterEach(async () => { if (storageInstance) { await storageInstance.cleanup(Infinity) - storageInstance = undefined + await storageInstance.close() } }) @@ -270,7 +270,7 @@ export function testCorrectQueries( schema, options: {}, multiInstance: false, - devMode: true + devMode: false }); const rawDocsData = input.data.map(row => { diff --git a/packages/test-suite/src/helper/schemas.ts b/packages/test-suite/src/helper/schemas.ts index 295f2bba..862f1dc4 100644 --- a/packages/test-suite/src/helper/schemas.ts +++ b/packages/test-suite/src/helper/schemas.ts @@ -60,7 +60,7 @@ export const humanSchemaLiteral = overwritable.deepFreezeWhenDevMode({ } }, required: ['firstName', 'lastName', 'passportId', 'age'], - indexes: ['firstName'] + indexes: ['firstName'], } as const) const humanSchemaTyped = toTypedRxJsonSchema(humanSchemaLiteral) export type HumanDocumentType = ExtractDocumentTypeFromTypedRxJsonSchema diff --git a/packages/test-suite/src/index.ts b/packages/test-suite/src/index.ts index 6c38ae62..ad064bb3 100644 --- a/packages/test-suite/src/index.ts +++ b/packages/test-suite/src/index.ts @@ -99,7 +99,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false, password: randomCouchString(24) }) @@ -118,7 +118,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName, schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false, password: randomCouchString(24) }) @@ -136,7 +136,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const pkey = 'foobar' @@ -156,7 +156,6 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void }], testContext ) - expect(writeResponse.error).toStrictEqual([]) const first = writeResponse.success.at(0); expect(docData).toStrictEqual(first) @@ -169,7 +168,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const pkey = 'foobar' @@ -196,7 +195,6 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void }], testContext ) - expect(writeResponse.success).toStrictEqual([]) expect(writeResponse.error.at(0)).not.toBe(undefined) const first = writeResponse.error.at(0)! @@ -228,7 +226,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const pkey = 'foobar' @@ -273,7 +271,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -353,7 +351,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: schema as any, options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const docId = 'foobar' @@ -373,9 +371,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void }], testContext ) - expect(writeResponse.success.at(0)).not.toBe(undefined) - const insertResponse = writeResponse.success.at(0) const insertDataAfterWrite: RxDocumentData = Object.assign( {}, @@ -384,7 +380,6 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void _rev: insertResponse._rev } ) - const updateResponse = await storageInstance.bulkWrite( [{ previous: insertDataAfterWrite, @@ -401,15 +396,12 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void }], testContext ) - expect(updateResponse.success.at(0)).not.toBe(undefined) const updateResponseDoc = updateResponse.success.at(0)! - delete (updateResponseDoc)._deleted delete (updateResponseDoc)._rev delete (updateResponseDoc)._meta - expect(updateResponseDoc).toStrictEqual({ key: docId, _attachments: {} @@ -424,7 +416,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -498,7 +490,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const docData: RxDocumentWriteData = { @@ -523,7 +515,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) await storageInstance2.bulkWrite( @@ -550,7 +542,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const pkey = 'foobar' @@ -612,7 +604,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) await Promise.all( @@ -645,7 +637,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const umlauts = 'äöüßé' @@ -731,7 +723,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void ] }), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -765,7 +757,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getTestDataSchema(), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -813,7 +805,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getTestDataSchema(), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -872,8 +864,8 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, '_id' as any), options: {}, - multiInstance: false, - devMode: true + multiInstance: true, + devMode: false }); const query: FilledMangoQuery = { @@ -962,7 +954,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion<{ key: string, value: string }>(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -1034,7 +1026,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getTestDataSchema(), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -1116,7 +1108,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema, options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -1210,7 +1202,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema, options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const insertResult = await storageInstance.bulkWrite([ @@ -1260,7 +1252,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema, options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -1303,7 +1295,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema, options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) const preparedQueryAll = prepareQuery( @@ -1338,7 +1330,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getPseudoSchemaForVersion(0, 'key'), options: {}, - multiInstance: false, + multiInstance: true, devMode: false }) @@ -1379,7 +1371,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void collectionName: randomCouchString(12), schema: getTestDataSchema(), options: {}, - multiInstance: false, + multiInstance: true, devMode: false })