Skip to content

Conversation

@maxnowack
Copy link
Owner

@maxnowack maxnowack commented Jul 11, 2025

The main goal of version 2 of SignalDB is to switch the architecture to the new data layer while keeping breaking changes as minimal as possible.

In this first draft, I refactored all data handling stuff and moved it from the collection to the DefaultDataAdapter, which keeps mostly the current behavior, but uses the DataAdapter abstraction to allow more flexibility.

I'm still unsure about the name DataAdapter. The idea was to keep it consistent with the other naming, but I'm definitely open for better ideas!

ToDo:

  • Switch to better storage/persistence adapter
  • Develop abstract adapter as base for opfs and fs adapters
  • Add more data adapters
    • Worker
    • Async
    • AutoFetch
  • Write upgrade guide
  • Fix failing tests
  • Resolve TODO comments
  • Ensure coverage
  • Update documentation

resolves #397
resolves #1557
resolves #1639

Still a long way to go, but the first step was made 🎉
I highly appreciate any reviews!

@maxnowack maxnowack added this to the v2.0.0 milestone Jul 11, 2025
@codecov
Copy link

codecov bot commented Jul 11, 2025

❌ 67 Tests Failed:

Tests completed Failed Passed Skipped
675 67 608 0
View the top 3 failed test(s) by shortest run time
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > covers database error handling
Stack Traces | 0.000449s run time
TypeError: adapter.setup is not a function
 ❯ __tests__/adapter.spec.ts:219:21
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > handles upgrade callback and error scenarios
Stack Traces | 0.000494s run time
TypeError: adapter.setup is not a function
 ❯ __tests__/adapter.spec.ts:239:21
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > removeAll clears the store
Stack Traces | 0.000508s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > handles fileExists directory check fallback
Stack Traces | 0.00052s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:394:7
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > replace is a no-op when id not found; remove is a no-op when id not found
Stack Traces | 0.000529s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > throws error when dropIndex is called after setup
Stack Traces | 0.000548s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:207:36
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > readIds returns specific items when found
Stack Traces | 0.000564s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/base/sync/__tests__/SyncManager.spec.ts > exercises error handler via intercepted DataAdapter calls
Stack Traces | 0.000564s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/SyncManager.spec.ts:1638:30
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > covers fileExists directory check path
Stack Traces | 0.000575s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:420:7
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > throws error when createIndex is called after setup
Stack Traces | 0.000578s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:201:36
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > handles recursive directory removal in listFilesRecursive
Stack Traces | 0.0006s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:404:7
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > covers listFilesRecursive with directory entries
Stack Traces | 0.000601s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:459:7
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > throws error when operations are called before setup
Stack Traces | 0.000633s run time
TypeError: adapter.readAll is not a function
 ❯ __tests__/adapter.spec.ts:197:28
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > readPositions accepts an array of positions and returns [] when nothing was found
Stack Traces | 0.000634s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > createIndex / readIndex / dropIndex work and errors are surfaced
Stack Traces | 0.000647s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > insert writes items and readAll returns raw data only
Stack Traces | 0.000654s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > handles custom serialization options
Stack Traces | 0.000693s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:302:7
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > supports numeric ids and hex sharding (covers lines 92-93)
Stack Traces | 0.000696s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:324:7
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > filename sanitization > handles complex object IDs
Stack Traces | 0.000761s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:283:7
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > handles nested directories in listFilesRecursive
Stack Traces | 0.000762s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:355:7
packages/storage-adapters/fs/__tests__/adapter.spec.ts > Filesystem storage adapter > CRUD + indexing > replace throws when id not found; remove throws when id not found (stricter than IDB)
Stack Traces | 0.000767s run time
Error: Cannot create index on id field
 ❯ Object.createIndex ...../generic-fs/src/index.ts:312:23
 ❯ withAdapter __tests__/adapter.spec.ts:33:19
 ❯ __tests__/adapter.spec.ts:108:44
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > error handling > handles directory checks in fileExists
Stack Traces | 0.000778s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:345:7
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > CRUD + indexing > replace throws when id not found; remove throws when id not found (parity with FS)
Stack Traces | 0.000831s run time
Error: Cannot create index on id field
 ❯ Object.createIndex ...../generic-fs/src/index.ts:312:23
 ❯ withAdapter __tests__/adapter.spec.ts:162:19
 ❯ __tests__/adapter.spec.ts:236:39
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > error handling > handles database without upgrade logic
Stack Traces | 0.00085s run time
TypeError: adapter.setup is not a function
 ❯ __tests__/adapter.spec.ts:189:21
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > CRUD + indexing > readIds returns specific items by id
Stack Traces | 0.00102s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:265:7
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > CRUD + indexing > readAll returns [] initially
Stack Traces | 0.00102s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:76:27
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > exec throws when collection not registered and internal helpers with missing maps
Stack Traces | 0.00106s run time
TypeError: adapter.queryListeners is not a function
 ❯ __tests__/WorkerDataAdapter.spec.ts:628:20
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > CRUD + indexing > removeAll clears the store
Stack Traces | 0.00115s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:248:7
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle operations with no matching items
Stack Traces | 0.00224s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'upd1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [],
+     "data": null,
      "error": null,
-     "id": "upd1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [],
+     "data": undefined,
      "error": null,
-     "id": "upd1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [],
-     "error": null,
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
+     },
      "id": "upd1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1024:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > more empty/no-match early returns
Stack Traces | 0.00251s run time
AssertionError: expected "spy" to be called with arguments: [ ObjectContaining{…} ]

Received: 

  1st spy call:

  [
-   ObjectContaining {
-     "data": [],
-     "id": "um",
-     "type": "response",
+   {
+     "data": null,
+     "error": null,
+     "id": "ready",
+     "type": "ready",
+     "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
-   ObjectContaining {
-     "data": [],
-     "id": "um",
+   {
+     "data": undefined,
+     "error": null,
+     "id": "reg",
      "type": "response",
+     "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
-   ObjectContaining {
-     "data": [],
+   {
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
+     },
      "id": "um",
      "type": "response",
+     "workerId": "test-host",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:822:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > executeQuery options branches and empty-affected-queries path
Stack Traces | 0.00264s run time
AssertionError: expected +0 to be 1 // Object.is equality

- Expected
+ Received

- 1
+ 0

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:804:27
packages/base/sync/__tests__/SyncManager.spec.ts > should handle storage errors with error handler callback
Stack Traces | 0.00279s run time
AssertionError: expected undefined to be defined
 ❯ __tests__/SyncManager.spec.ts:1605:31
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > CRUD + indexing > createIndex / readIndex / dropIndex work and errors are surfaced
Stack Traces | 0.00301s run time
Error: Cannot create index on id field
 ❯ Object.createIndex ...../generic-fs/src/index.ts:312:23
 ❯ withAdapter __tests__/adapter.spec.ts:162:19
 ❯ __tests__/adapter.spec.ts:217:41
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle removeOne message
Stack Traces | 0.00305s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'rem1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "rem1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "rem1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rem1",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "selectors.map is not a function",
      },
-     ],
-     "error": null,
      "id": "rem1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 4

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:436:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should error on updateMany when new id collides
Stack Traces | 0.00309s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'updManyCollision', …(4) } ]

Received: 

  1st spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "updManyCollision",
-     "type": "response",
+     "error": null,
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "updManyCollision",
+     "data": undefined,
+     "error": null,
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "updManyCollision",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "updManyCollision",
+     "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

@@ -1,10 +1,10 @@
  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
      "id": "updManyCollision",
      "type": "response",
      "workerId": "test-host",
    },


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1322:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle query updates after mutations
Stack Traces | 0.0031s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'ins1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": {
-       "id": "1",
-       "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "error": null,
      "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 1

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:869:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle removeMany message
Stack Traces | 0.00316s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'remMany1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-       {
-         "id": "2",
-         "name": "test",
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "remMany1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-       {
-         "id": "2",
-         "name": "test",
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "remMany1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-       {
-         "id": "2",
-         "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "remMany1",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-       {
-         "id": "2",
-         "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "remMany1",
+     "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-       },
-       {
-         "id": "2",
-         "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "selectors.map is not a function",
      },
-     ],
-     "error": null,
      "id": "remMany1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:486:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle updateOne message
Stack Traces | 0.00351s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'upd1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "updated",
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "upd1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "updated",
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "upd1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "updated",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "upd1",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "updated",
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
-     ],
-     "error": null,
      "id": "upd1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 4

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:300:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle replaceOne message
Stack Traces | 0.00359s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'rep1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "replaced",
-         "value": 100,
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "rep1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "replaced",
-         "value": 100,
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "rep1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "replaced",
-         "value": 100,
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rep1",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "replaced",
-         "value": 100,
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
-     ],
-     "error": null,
      "id": "rep1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 4

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:394:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > covers getIndexInfo edge paths and queryItems guards
Stack Traces | 0.00411s run time
AssertionError: expected 0 to be greater than 0
 ❯ __tests__/WorkerDataAdapterHost.spec.ts:736:25
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should use index include for matching selector
Stack Traces | 0.0042s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'rmAlice', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "alice",
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "rmAlice",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "alice",
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "rmAlice",
+     "id": "reg",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "alice",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rmAlice",
+     "id": "i1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "alice",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rmAlice",
+     "id": "i2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "alice",
+     "data": null,
+     "error": TypeError {
+       "message": "selectors.map is not a function",
      },
-     ],
-     "error": null,
      "id": "rmAlice",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1184:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should error on updateOne when new id collides
Stack Traces | 0.00424s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'u1', …(4) } ]

Received: 

  1st spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "u1",
-     "type": "response",
+     "error": null,
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "u1",
+     "data": undefined,
+     "error": null,
+     "id": "regu",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "u1",
+     "id": "i1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "u1",
+     "id": "i2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

@@ -1,10 +1,10 @@
  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
      "id": "u1",
      "type": "response",
      "workerId": "test-host",
    },


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1274:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should error on replaceOne when new id collides
Stack Traces | 0.00446s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'replCollision', …(4) } ]

Received: 

  1st spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "replCollision",
-     "type": "response",
+     "error": null,
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
-     },
-     "id": "replCollision",
+     "data": undefined,
+     "error": null,
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "replCollision",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "replCollision",
+     "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

@@ -1,10 +1,10 @@
  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 2 already exists",
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
      "id": "replCollision",
      "type": "response",
      "workerId": "test-host",
    },


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1370:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle updateMany message
Stack Traces | 0.00518s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'updMany1', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-         "value": 100,
-       },
-       {
-         "id": "2",
-         "name": "test",
-         "value": 100,
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "updMany1",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-         "value": 100,
-       },
-       {
-         "id": "2",
-         "name": "test",
-         "value": 100,
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "updMany1",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-         "value": 100,
-       },
-       {
-         "id": "2",
-         "name": "test",
-         "value": 100,
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "updMany1",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-         "value": 100,
-       },
-       {
-         "id": "2",
-         "name": "test",
-         "value": 100,
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "updMany1",
+     "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

  [
    {
-     "data": [
-       {
-         "id": "1",
-         "name": "test",
-         "value": 100,
-       },
-       {
-         "id": "2",
-         "name": "test",
-         "value": 100,
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
-     ],
-     "error": null,
      "id": "updMany1",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:350:43
packages/base/sync/__tests__/SyncManager.spec.ts > should register error handlers for internal persistence adapters
Stack Traces | 0.00541s run time
AssertionError: expected "spy" to be called with arguments: [ { name: 'test' }, …(1) ]

Number of calls: 0

 ❯ __tests__/SyncManager.spec.ts:983:24
packages/storage-adapters/indexeddb/__tests__/indexeddb.spec.ts > indexeddb adapter > covers setup, CRUD and index paths
Stack Traces | 0.00561s run time
TypeError: adapter.createIndex is not a function
 ❯ __tests__/indexeddb.spec.ts:161:19
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should project fields (exclude id) on queryUpdate complete
Stack Traces | 0.00632s run time
AssertionError: expected "spy" to be called with arguments: [ ObjectContaining{…} ]

Received: 

  1st spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
-         },
-       ],
-       "state": "complete",
-     },
-     "type": "queryUpdate",
+   {
+     "data": null,
+     "error": null,
+     "id": "ready",
+     "type": "ready",
+     "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
-         },
-       ],
-       "state": "complete",
-     },
-     "type": "queryUpdate",
+   {
+     "data": undefined,
+     "error": null,
+     "id": "regp",
+     "type": "response",
+     "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
+   {
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-       ],
-       "state": "complete",
-     },
-     "type": "queryUpdate",
+     "id": "insp",
+     "type": "response",
+     "workerId": "test-host",
    },
  ]

  4th spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
+   {
+     "data": {
+       "collectionName": "proj",
+       "error": null,
+       "items": [],
+       "options": {
+         "fields": {
+           "id": 0,
+           "name": 1,
          },
-       ],
+       },
+       "selector": {
+         "name": "n",
+       },
        "state": "complete",
      },
+     "error": null,
+     "id": "{\"name\":\"n\"}:{\"fields\":{\"id\":0,\"name\":1}}",
      "type": "queryUpdate",
+     "workerId": "test-host",
    },
  ]

  5th spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
-         },
-       ],
-       "state": "complete",
-     },
-     "type": "queryUpdate",
+   {
+     "data": undefined,
+     "error": null,
+     "id": "regQp",
+     "type": "response",
+     "workerId": "test-host",
    },
  ]

  6th spy call:

  [
-   ObjectContaining {
-     "data": ObjectContaining {
-       "items": [
-         ObjectNotContaining {
-           "id": Anything,
+   {
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
      },
-       ],
-       "state": "complete",
-     },
-     "type": "queryUpdate",
+     "id": "updp",
+     "type": "response",
+     "workerId": "test-host",
    },
  ]


Number of calls: 6

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1256:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle $exists false and null selectors in indexed paths
Stack Traces | 0.00637s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'updExists', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [],
+     "data": null,
      "error": null,
-     "id": "updExists",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [],
+     "data": undefined,
      "error": null,
-     "id": "updExists",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [],
-     "error": null,
-     "id": "updExists",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
+     },
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [],
-     "error": null,
-     "id": "updExists",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
+     },
+     "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

  [
    {
-     "data": [],
-     "error": null,
+     "data": null,
+     "error": TypeError {
+       "message": "parameters.map is not a function",
+     },
      "id": "updExists",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1074:43
packages/base/core/__tests__/DefaultDataAdapter.spec.ts > DefaultDataAdapter > registerQuery throws without emitter and unregisterQuery early-returns
Stack Traces | 0.00684s run time
AssertionError: expected [Function] to throw an error

- Expected: 
null

+ Received: 
undefined

 ❯ __tests__/DefaultDataAdapter.spec.ts:216:49
packages/base/core/__tests__/WorkerDataAdapter.extra.spec.ts > WorkerDataAdapter extra coverage > unsubscribes onQueryStateChange correctly
Stack Traces | 0.0071s run time
AssertionError: expected "spy" to be called at least once
 ❯ __tests__/WorkerDataAdapter.extra.spec.ts:108:22
packages/storage-adapters/indexeddb/__tests__/adapter.spec.ts > IndexedDB storage adapter > setup/teardown > opens and closes with custom db & version even without upgrade logic
Stack Traces | 0.00767s run time
TypeError: adapter.setup is not a function
 ❯ withAdapter __tests__/adapter.spec.ts:58:17
 ❯ __tests__/adapter.spec.ts:65:33
packages/storage-adapters/fs/__tests__/adapter.spec.ts > Filesystem storage adapter > CRUD + indexing > createIndex / readIndex / dropIndex work and errors are surfaced
Stack Traces | 0.00874s run time
Error: Cannot create index on id field
 ❯ Object.createIndex ...../generic-fs/src/index.ts:312:23
 ❯ withAdapter __tests__/adapter.spec.ts:33:19
 ❯ __tests__/adapter.spec.ts:89:46
packages/storage-adapters/localstorage/__tests__/adapter.spec.ts > LocalStorage storage adapter > CRUD + indexing (parity with IndexedDB tests) > replace is a no-op when id not found; remove is a no-op when id not found
Stack Traces | 0.00874s run time
Error: Cannot create index on id field
 ❯ Object.createIndex src/index.ts:4930:15
 ❯ withAdapter __tests__/adapter.spec.ts:35:19
 ❯ __tests__/adapter.spec.ts:76:36
packages/storage-adapters/opfs/__tests__/adapter.spec.ts > OPFS storage adapter > CRUD + indexing > insert writes items and readAll returns raw data only
Stack Traces | 0.0092s run time
TypeError: Cannot read properties of null (reading 'request')
 ❯ withPathLock src/index.ts:99:12
 ❯ Object.writeObject src/index.ts:2140:14
 ❯ ...../generic-fs/src/index.ts:275:30
 ❯ D ...../generic-fs/src/index.ts:267:9
 ❯ Object.insert ...../generic-fs/src/index.ts:325:13
 ❯ __tests__/adapter.spec.ts:199:7
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle duplicate id errors
Stack Traces | 0.0108s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'ins2', …(4) } ]

Received: 

  1st spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 1 already exists",
-     },
-     "id": "ins2",
-     "type": "response",
+     "error": null,
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 1 already exists",
-     },
-     "id": "ins2",
+     "data": undefined,
+     "error": null,
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 1 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "id": "ins2",
+     "id": "ins1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

@@ -1,10 +1,10 @@
  [
    {
      "data": null,
-     "error": ObjectContaining {
-       "message": "Item with id 1 already exists",
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
      "id": "ins2",
      "type": "response",
      "workerId": "test-host",
    },


Number of calls: 4

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1134:43
packages/base/core/__tests__/Collection.spec.ts > Collection > additional coverage: Collection/Cursor/Observer > getItems async error path and private getItem sync path
Stack Traces | 0.0145s run time
TypeError: this.backend.executeQuery is not a function
 ❯ fn src/Collection/index.ts:626:3
 ❯ Collection.profile src/Collection/index.ts:570:18
 ❯ Collection.getItems src/Collection/index.ts:626:3
 ❯ __tests__/Collection.spec.ts:766:31
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should handle insert message
Stack Traces | 0.0151s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'msg2', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": {
-       "id": "1",
-       "name": "test",
-     },
+     "data": null,
      "error": null,
-     "id": "msg2",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": {
-       "id": "1",
-       "name": "test",
-     },
+     "data": undefined,
      "error": null,
-     "id": "msg2",
+     "id": "reg1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": {
-       "id": "1",
-       "name": "test",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     "error": null,
      "id": "msg2",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:258:43
packages/base/core/__tests__/WorkerDataAdapterHost.spec.ts > WorkerDataAdapterHost > should use index exclude for $ne selector
Stack Traces | 0.0201s run time
AssertionError: expected "spy" to be called with arguments: [ { id: 'rmNotAlice', …(4) } ]

Received: 

  1st spy call:

  [
    {
-     "data": [
-       {
-         "id": "2",
-         "name": "bob",
-       },
-     ],
+     "data": null,
      "error": null,
-     "id": "rmNotAlice",
-     "type": "response",
+     "id": "ready",
+     "type": "ready",
      "workerId": "test-host",
    },
  ]

  2nd spy call:

  [
    {
-     "data": [
-       {
-         "id": "2",
-         "name": "bob",
-       },
-     ],
+     "data": undefined,
      "error": null,
-     "id": "rmNotAlice",
+     "id": "reg",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  3rd spy call:

  [
    {
-     "data": [
-       {
-         "id": "2",
-         "name": "bob",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rmNotAlice",
+     "id": "i1",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  4th spy call:

  [
    {
-     "data": [
-       {
-         "id": "2",
-         "name": "bob",
+     "data": null,
+     "error": TypeError {
+       "message": "input.map is not a function",
      },
-     ],
-     "error": null,
-     "id": "rmNotAlice",
+     "id": "i2",
      "type": "response",
      "workerId": "test-host",
    },
  ]

  5th spy call:

  [
    {
-     "data": [
-       {
-         "id": "2",
-         "name": "bob",
+     "data": null,
+     "error": TypeError {
+       "message": "selectors.map is not a function",
      },
-     ],
-     "error": null,
      "id": "rmNotAlice",
      "type": "response",
      "workerId": "test-host",
    },
  ]


Number of calls: 5

 ❯ __tests__/WorkerDataAdapterHost.spec.ts:1211:43
packages/base/core/__tests__/AutoFetchDataAdapter.spec.ts > AutoFetchDataAdapter > sets up storage and indices on ready
Stack Traces | 0.0284s run time
AssertionError: promise rejected "Error: Index on field "id" does not exist" instead of resolving
 ❯ __tests__/AutoFetchDataAdapter.spec.ts:20:41

Caused by: Caused by: Caused by: Error: Index on field "id" does not exist
 ❯ Object.readIndex __tests__/helpers/memoryStorageAdapter.ts:1570:15
 ❯ __tests__/AutoFetchDataAdapter.spec.ts:20:26
packages/base/sync/__tests__/SyncManager.spec.ts > should handle errors with onError handler in event listeners
Stack Traces | 0.0518s run time
AssertionError: expected "spy" to be called at least once
 ❯ __tests__/SyncManager.spec.ts:1567:19
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > registerQuery increments listeners and avoids duplicate register, unregister branches both paths
Stack Traces | 0.055s run time
AssertionError: expected true to be false // Object.is equality

- Expected
+ Received

- false
+ true

 ❯ __tests__/WorkerDataAdapter.spec.ts:382:29
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle updateMany operation
Stack Traces | 1s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "name": "test",
-       },
-       {
-         "$set": {
-           "name": "updated",
-         },
-       },
      ],
-     "id": Any<String>,
-     "method": "updateMany",
+     "id": "7zxpz87frkd5ah14",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "name": "test",
-       },
-       {
-         "$set": {
-           "name": "updated",
-         },
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "updateMany",
+     "id": "7kshaav8m8nlif3z",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "name": "test",
            },
            {
              "$set": {
                "name": "updated",
              },
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "yqnfxw63ntlcdk33",
      "method": "updateMany",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:240:59
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle replaceOne operation
Stack Traces | 1s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
-       {
-         "name": "replaced",
-         "value": 100,
-       },
      ],
-     "id": Any<String>,
-     "method": "replaceOne",
+     "id": "o1pb524kuriksyme",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
-       {
-         "name": "replaced",
-         "value": 100,
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "replaceOne",
+     "id": "iki781fpnlx34bo2",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "id": "1",
            },
            {
              "name": "replaced",
              "value": 100,
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "q6kkhxms0k871v6s",
      "method": "replaceOne",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:266:59
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle removeMany operation
Stack Traces | 1s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "name": "test",
-       },
      ],
-     "id": Any<String>,
-     "method": "removeMany",
+     "id": "sxhcdkpfgqzpqqao",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "name": "test",
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "removeMany",
+     "id": "9fm8s562046f0a62",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "name": "test",
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "lvjgrxsg15nv09w3",
      "method": "removeMany",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:318:59
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle updateOne operation
Stack Traces | 1s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
-       {
-         "$set": {
-           "name": "updated",
-         },
-       },
      ],
-     "id": Any<String>,
-     "method": "updateOne",
+     "id": "hcw4ol1kcvayblrq",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
-       {
-         "$set": {
-           "name": "updated",
-         },
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "updateOne",
+     "id": "2zp76fu9pjkw6jrw",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "id": "1",
            },
            {
              "$set": {
                "name": "updated",
              },
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "75g64tro3wu18usu",
      "method": "updateOne",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:214:59
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle removeOne operation
Stack Traces | 1s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
      ],
-     "id": Any<String>,
-     "method": "removeOne",
+     "id": "sajemqxwk5t0g7wm",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "removeOne",
+     "id": "57t2hita3g1g7enb",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "id": "1",
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "39d3iq7fxfu009vx",
      "method": "removeOne",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:292:59
packages/base/core/__tests__/WorkerDataAdapter.spec.ts > WorkerDataAdapter > should handle insert operation
Stack Traces | 1.02s run time
AssertionError: expected "spy" to be called with arguments: [ { id: Any<String>, …(3) } ]

Received: 

  1st spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-         "name": "test",
-       },
      ],
-     "id": Any<String>,
-     "method": "insert",
+     "id": "p5ymwqvpy94y46n1",
+     "method": "isReady",
      "workerId": "test-adapter",
    },
  ]

  2nd spy call:

  [
    {
      "args": [
        "test",
-       {
-         "id": "1",
-         "name": "test",
-       },
+       [],
      ],
-     "id": Any<String>,
-     "method": "insert",
+     "id": "u8zvhrd650qasjqb",
+     "method": "registerCollection",
      "workerId": "test-adapter",
    },
  ]

  3rd spy call:

  [
    {
      "args": [
        "test",
+       [
+         [
            {
              "id": "1",
              "name": "test",
            },
          ],
-     "id": Any<String>,
+       ],
+     ],
+     "id": "dey6t9v5b9zni7gs",
      "method": "insert",
      "workerId": "test-adapter",
    },
  ]


Number of calls: 3

 ❯ __tests__/WorkerDataAdapter.spec.ts:182:59

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@codecov
Copy link

codecov bot commented Jul 11, 2025

Bundle Report

Changes will increase total bundle size by 330.97kB (4.32%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@signaldb/core 343.63kB 125.48kB (57.52%) ⬆️
@signaldb/sync 155.34kB 2.62kB (1.71%) ⬆️
@signaldb/devtools 6.86MB 1.28kB (0.02%) ⬆️
@signaldb/indexeddb 42.03kB 27.91kB (197.5%) ⬆️
@signaldb/fs 78.39kB 57.93kB (283.19%) ⬆️
@signaldb/opfs 34.56kB 15.49kB (81.2%) ⬆️
@signaldb/localstorage 44.22kB 30.98kB (234.18%) ⬆️
@signaldb/generic-fs 69.27kB 69.27kB (100%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @signaldb/devtools

Assets Changed:

Asset Name Size Change Total Size Change (%)
setup-BFZirWvx.mjs.map (New) 2.68MB 2.68MB 100.0% 🚀
index.umd.js.map 505 bytes 2.58MB 0.02%
setup-BFZirWvx.mjs (New) 973.81kB 973.81kB 100.0% 🚀
index.umd.js 89 bytes 611.26kB 0.01%
components/Table/index.d.ts 27 bytes 618 bytes 4.57%
components/Table/Item.d.ts 18 bytes 505 bytes 3.7%
setup-BYqaZNTn.mjs.map (Deleted) -2.68MB 0 bytes -100.0% 🗑️
setup-BYqaZNTn.mjs (Deleted) -973.68kB 0 bytes -100.0% 🗑️
view changes for bundle: @signaldb/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.cjs16.js 21.66kB 22.46kB 2697.14% ⚠️
index16.mjs 21.58kB 22.36kB 2766.41% ⚠️
index.cjs3.js -9.74kB 20.55kB -32.16%
index3.mjs -9.75kB 20.35kB -32.39%
index.cjs13.js 11.39kB 15.89kB 252.65% ⚠️
index13.mjs 11.29kB 15.79kB 250.91% ⚠️
index.cjs15.js 15.17kB 15.52kB 4372.05% ⚠️
index15.mjs 15.09kB 15.41kB 4744.97% ⚠️
index.cjs12.js 15.16kB 15.28kB 12528.1% ⚠️
Collection/index.d.ts 891 bytes 15.25kB 6.2% ⚠️
index12.mjs 15.05kB 15.16kB 13199.12% ⚠️
index.cjs2.js 24 bytes 9.83kB 0.24%
index2.mjs 40 bytes 9.68kB 0.42%
.vite/manifest.json 1.26kB 7.33kB 20.8% ⚠️
index.cjs14.js 4.61kB 7.04kB 189.4% ⚠️
index14.mjs 4.76kB 7.01kB 210.86% ⚠️
Collection/Cursor.d.ts 342 bytes 6.48kB 5.57% ⚠️
index.cjs17.js 236 bytes 5.22kB 4.74%
index17.mjs 236 bytes 5.19kB 4.76%
index.cjs22.js 1.98kB 4.76kB 71.34% ⚠️
index22.mjs 1.98kB 4.61kB 75.49% ⚠️
index.cjs9.js 4.38kB 4.51kB 3476.98% ⚠️
index9.mjs 4.38kB 4.5kB 3681.51% ⚠️
AutoFetchDataAdapter.d.ts (New) 4.33kB 4.33kB 100.0% 🚀
WorkerDataAdapterHost.d.ts (New) 3.26kB 3.26kB 100.0% 🚀
index.cjs21.js 2.5kB 3.15kB 383.87% ⚠️
index21.mjs 2.47kB 3.11kB 383.07% ⚠️
Collection/Observer.d.ts 70 bytes 2.86kB 2.51%
AsyncDataAdapter.d.ts (New) 2.51kB 2.51kB 100.0% 🚀
getIndexInfo.d.ts (New) 2.42kB 2.42kB 100.0% 🚀
DataAdapter.d.ts (New) 2.05kB 2.05kB 100.0% 🚀
index.d.ts 89 bytes 1.46kB 6.49% ⚠️
index.cjs.js 119 bytes 1.45kB 8.92% ⚠️
index.mjs 153 bytes 1.25kB 13.91% ⚠️
DefaultDataAdapter.d.ts (New) 1.22kB 1.22kB 100.0% 🚀
index.cjs27.js 955 bytes 1.16kB 468.14% ⚠️
index27.mjs 955 bytes 1.15kB 484.77% ⚠️
index.cjs26.js 740 bytes 1.02kB 268.12% ⚠️
index26.mjs 724 bytes 993 bytes 269.14% ⚠️
types/IndexProvider.d.ts 255 bytes 890 bytes 40.16% ⚠️
WorkerDataAdapter.d.ts (New) 871 bytes 871 bytes 100.0% 🚀
index.cjs33.js (New) 815 bytes 815 bytes 100.0% 🚀
index33.mjs (New) 808 bytes 808 bytes 100.0% 🚀
index.cjs24.js 345 bytes 803 bytes 75.33% ⚠️
Collection/types.d.ts -173 bytes 802 bytes -17.74%
index24.mjs 329 bytes 780 bytes 72.95% ⚠️
index.cjs31.js (New) 763 bytes 763 bytes 100.0% 🚀
index31.mjs (New) 756 bytes 756 bytes 100.0% 🚀
index.cjs6.js 604 bytes 722 bytes 511.86% ⚠️
index6.mjs 604 bytes 715 bytes 544.14% ⚠️
utils/batchOnNextTick.d.ts (New) 686 bytes 686 bytes 100.0% 🚀
index.cjs18.js 476 bytes 651 bytes 272.0% ⚠️
index18.mjs 483 bytes 644 bytes 300.0% ⚠️
types/StorageAdapter.d.ts (New) 612 bytes 612 bytes 100.0% 🚀
index.cjs10.js -264 bytes 458 bytes -36.57%
index10.mjs -264 bytes 451 bytes -36.92%
utils/queryId.d.ts (New) 435 bytes 435 bytes 100.0% 🚀
index.cjs11.js 7 bytes 389 bytes 1.83%
index.cjs7.js 264 bytes 382 bytes 223.73% ⚠️
index11.mjs 29 bytes 382 bytes 8.22% ⚠️
createStorageAdapter.d.ts (New) 380 bytes 380 bytes 100.0% 🚀
createIndex.d.ts (New) 369 bytes 369 bytes 100.0% 🚀
utils/objectId.d.ts (New) 367 bytes 367 bytes 100.0% 🚀
index7.mjs 242 bytes 353 bytes 218.02% ⚠️
index.cjs25.js -416 bytes 347 bytes -54.52%
index25.mjs -438 bytes 318 bytes -57.94%
index.cjs32.js (New) 276 bytes 276 bytes 100.0% 🚀
index32.mjs (New) 269 bytes 269 bytes 100.0% 🚀
index.cjs20.js -155 bytes 234 bytes -39.85%
index20.mjs -155 bytes 227 bytes -40.58%
index.cjs30.js (New) 204 bytes 204 bytes 100.0% 🚀
index30.mjs (New) 197 bytes 197 bytes 100.0% 🚀
index.cjs8.js 61 bytes 189 bytes 47.66% ⚠️
index8.mjs 61 bytes 182 bytes 50.41% ⚠️
index.cjs23.js -3.67kB 175 bytes -95.45%
index23.mjs -3.5kB 161 bytes -95.6%
index.cjs28.js -872 bytes 144 bytes -85.83%
index28.mjs -856 bytes 137 bytes -86.2%
index.cjs5.js -2.12kB 126 bytes -94.4%
index.cjs4.js -6.4kB 120 bytes -98.16%
index5.mjs -1.97kB 119 bytes -94.29%
index.cjs29.js -697 bytes 118 bytes -85.52%
index4.mjs -6.38kB 113 bytes -98.26%
index29.mjs -697 bytes 111 bytes -86.26%
ReplicatedCollection.d.ts (Deleted) -3.64kB 0 bytes -100.0% 🗑️
AutoFetchCollection.d.ts (Deleted) -2.57kB 0 bytes -100.0% 🗑️
persistence/combinePersistenceAdapters.d.ts (Deleted) -2.26kB 0 bytes -100.0% 🗑️
Collection/getIndexInfo.d.ts (Deleted) -2.15kB 0 bytes -100.0% 🗑️
types/MemoryAdapter.d.ts (Deleted) -895 bytes 0 bytes -100.0% 🗑️
Collection/createIndex.d.ts (Deleted) -838 bytes 0 bytes -100.0% 🗑️
types/PersistenceAdapter.d.ts (Deleted) -531 bytes 0 bytes -100.0% 🗑️
persistence/createPersistenceAdapter.d.ts (Deleted) -413 bytes 0 bytes -100.0% 🗑️
createMemoryAdapter.d.ts (Deleted) -330 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @signaldb/fs

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs.map 21.53kB 28.99kB 288.36% ⚠️
index.umd.js.map 21.12kB 28.4kB 289.99% ⚠️
index.mjs 8.74kB 11.0kB 386.0% ⚠️
index.umd.js 6.05kB 7.86kB 333.65% ⚠️
index.d.ts -3 bytes 1.51kB -0.2%
.vite/manifest.json 192 bytes 315 bytes 156.1% ⚠️
__vite-browser-external-DYxpcVy9.mjs.map (New) 208 bytes 208 bytes 100.0% 🚀
__vite-browser-external-DYxpcVy9.mjs (New) 103 bytes 103 bytes 100.0% 🚀
view changes for bundle: @signaldb/indexeddb

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs.map 10.86kB 16.03kB 209.84% ⚠️
index.umd.js.map 10.5kB 15.57kB 206.82% ⚠️
index.mjs 3.76kB 5.25kB 254.15% ⚠️
index.umd.js 2.56kB 3.97kB 181.36% ⚠️
index.d.ts 227 bytes 1.09kB 26.27% ⚠️
view changes for bundle: @signaldb/localstorage

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs.map 12.91kB 17.63kB 273.59% ⚠️
index.umd.js.map 12.44kB 17.04kB 270.56% ⚠️
index.mjs 3.83kB 5.03kB 320.4% ⚠️
index.umd.js 2.43kB 3.47kB 232.69% ⚠️
index.d.ts -625 bytes 927 bytes -40.27%
view changes for bundle: @signaldb/opfs

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs.map 6.02kB 13.03kB 85.89% ⚠️
index.umd.js.map 5.99kB 12.84kB 87.51% ⚠️
index.mjs 1.89kB 3.82kB 98.13% ⚠️
index.umd.js 1.59kB 3.14kB 103.24% ⚠️
index.d.ts -7 bytes 1.62kB -0.43%
view changes for bundle: @signaldb/sync

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs.map 788 bytes 55.63kB 1.44%
index.umd.js.map 850 bytes 53.25kB 1.62%
index.mjs 518 bytes 20.19kB 2.63%
index.umd.js 220 bytes 11.68kB 1.92%
SyncManager.d.ts 31 bytes 8.22kB 0.38%
sync.d.ts 45 bytes 1.64kB 2.81%
types.d.ts 135 bytes 1.15kB 13.29% ⚠️
getSnapshot.d.ts 31 bytes 476 bytes 6.97% ⚠️

@maxnowack maxnowack force-pushed the v2 branch 2 times, most recently from 9e548b5 to cf47543 Compare July 16, 2025 12:19
@maxnowack maxnowack force-pushed the v2 branch 3 times, most recently from 0bde64d to a85ada9 Compare August 30, 2025 17:17
@maxnowack maxnowack force-pushed the v2 branch 6 times, most recently from 78f8b67 to 6a2e5d4 Compare September 6, 2025 17:59
@maxnowack maxnowack marked this pull request as ready for review September 6, 2025 18:03
@netlify
Copy link

netlify bot commented Sep 8, 2025

Deploy Preview for signaldb-docs ready!

Name Link
🔨 Latest commit 5c21025
🔍 Latest deploy log https://app.netlify.com/projects/signaldb-docs/deploys/68be7513ef7da50008e631c6
😎 Deploy Preview https://deploy-preview-1954--signaldb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@maxnowack
Copy link
Owner Author

Tests are passing and the coverage is at 100% again.

I've published beta versions (2.0.0-beta.0) for @signaldb/core, @signaldb/sync, @signaldb/fs, @signaldb/opfs, @signaldb/localstorage and @signaldb/indexeddb to npm.
Feel free to test and report bugs here in the PR as a comment! 🙂

New documentation isn't ready yet. I'll tackle this in the next days/weeks depending on how much time I could spend.
The first version of the upgrade guide is already there. You will find it here:
https://deploy-preview-1954--signaldb-docs.netlify.app/upgrade/v2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isReady should be Signal<Boolean> similar to isPulling, isLoading Async Collections

3 participants