diff --git a/CHANGELOG.md b/CHANGELOG.md index 47b951c0568..e1db93b2890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # RxDB Changelog - +- FIX remove `pouchdb-selector-core` dependency [#4722](https://github.com/pubkey/rxdb/issues/4722) diff --git a/package.json b/package.json index 6831b65a4a8..9cd711dc784 100644 --- a/package.json +++ b/package.json @@ -404,7 +404,6 @@ "oblivious-set": "1.1.1", "ohash": "1.1.2", "pako": "2.1.0", - "pouchdb-selector-core": "8.0.1", "reconnecting-websocket": "4.4.0", "simple-peer": "9.11.1", "socket.io-client": "4.6.1", @@ -520,4 +519,4 @@ "webpack-cli": "5.0.2", "webpack-dev-server": "4.13.3" } -} \ No newline at end of file +} diff --git a/src/plugins/dev-mode/check-query.ts b/src/plugins/dev-mode/check-query.ts index 1de88eccf99..cd83a9df644 100644 --- a/src/plugins/dev-mode/check-query.ts +++ b/src/plugins/dev-mode/check-query.ts @@ -9,9 +9,6 @@ import type { DefaultPreparedQuery } from '../../types'; import { newRxError, newRxTypeError } from '../../rx-error'; -import { - massageSelector -} from 'pouchdb-selector-core'; import { RxStorageDexieStatics } from '../storage-dexie'; import { deepEqual } from '../utils'; @@ -77,7 +74,7 @@ export function checkMangoQuery(args: RxPluginPrePrepareQueryArgs) { * Ensure that all top level fields are included in the schema. * TODO this check can be augmented to also check sub-fields. */ - const massagedSelector: MangoQuerySelector = massageSelector(args.mangoQuery.selector); + const massagedSelector: MangoQuerySelector = args.mangoQuery.selector; const schemaTopLevelFields = Object.keys(schema.properties); Object.keys(massagedSelector) // do not check operators diff --git a/src/types/modules/pouchdb-selector-core.d.ts b/src/types/modules/pouchdb-selector-core.d.ts deleted file mode 100644 index b4aa3f6116b..00000000000 --- a/src/types/modules/pouchdb-selector-core.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'pouchdb-selector-core'; diff --git a/test/unit/attachments-compression.test.ts b/test/unit/attachments-compression.test.ts index 6fbba75182b..959f39721eb 100644 --- a/test/unit/attachments-compression.test.ts +++ b/test/unit/attachments-compression.test.ts @@ -91,13 +91,11 @@ modes.forEach(mode => { it('should insert one attachment', async () => { const c = await createCompressedAttachmentsCollection(); const doc = await c.findOne().exec(true); - console.log('meow START'); const attachment = await doc.putAttachment({ id: 'cat.txt', data: createBlob('meow', 'text/plain'), type: 'text/plain' }); - console.log('meow END'); assert.ok(attachment); assert.strictEqual(attachment.id, 'cat.txt'); assert.strictEqual(attachment.type, 'text/plain'); diff --git a/test/unit/rx-query.test.ts b/test/unit/rx-query.test.ts index 9bfb929abd0..a9d757b5f25 100644 --- a/test/unit/rx-query.test.ts +++ b/test/unit/rx-query.test.ts @@ -358,39 +358,6 @@ describe('rx-query.test.ts', () => { }); }); config.parallel('.exec()', () => { - it('should throw if top level field is not known to the schema', async () => { - const col = await humansCollection.create(0); - - await AsyncTestUtil.assertThrows( - () => col.find({ - selector: { - asdfasdfasdf: 'asdf' - } as any - }).exec(), - 'RxError', - 'QU13' - ); - - // should also detect wrong fields inside of $and - await AsyncTestUtil.assertThrows( - () => col.find({ - selector: { - $and: [ - { - asdfasdfasdf: 'asdf' - } as any, - { - asdfasdfasdf: 'asdf' - } as any - ] - } - }).exec(), - 'RxError', - 'QU13' - ); - - col.database.destroy(); - }); it('reusing exec should not make a execOverDatabase', async () => { const col = await humansCollection.create(2); const q = col.find().where('passportId').ne('Alice');