UNPKG

rxdb

Version:

A local-first realtime NoSQL Database for JavaScript applications - https://rxdb.info/

697 lines (458 loc) 133 kB
# RxDB Changelog <!-- CHANGELOG NEWEST --> <!-- ADD new changes to orga/changelog/ as one file per change --> <!-- /CHANGELOG NEWEST --> <!-- RELEASE BELOW --> ### 17.2.0 (4 May 2026) - ADD React `useRxDocument(collection, primaryKey)` hook for subscribing to a single document by primary key with live updates - ADD React `useReplicationStatus(replicationState)` hook that exposes `syncing`, `error`, `lastSyncedAt`, and `canceled` from replication observables - DOCS Mark `liveQueryUpdateThrottleTime` as a beta feature in the documentation - DOCS Move the main `liveQueryUpdateThrottleTime` documentation to `rx-query.md`; `rx-database.md` and `rx-collection.md` now only list the option with a short description and a link - FIX `allAttachments$` observable emitting a new value on every document revision even when the set of attachments is unchanged, by filtering emissions with `distinctUntilChanged` based on attachment ids and digests - FIX `RxAttachment.remove()` not cleaning up binary attachment data from storage, because `categorizeBulkWriteRows()` only iterated over the new document's `_attachments` and never detected attachments removed between revisions - FIX attachments-compression `isCompressibleType()` not stripping RFC 2045 parameters (e.g. `; charset=utf-8`) from MIME types, causing attachments with a charset-qualified type like `application/json; charset=utf-8` to silently bypass compression when matched against exact patterns like `application/json` - FIX backup plugin not removing the folder of a deleted document when the change batch only contained deletions, because `findByIds()` returned an empty map and the loop exited early before running the deletion handler - FIX `RxCollection.cleanup()` returning `undefined` instead of `boolean` as declared by its TypeScript return type, because the cleanup plugin implementation did not return the result from `cleanupRxCollection()` - FIX CRDT plugin `bulkInsert` hook not including the composite primary key in CRDT operations, causing the primary key field to be lost during conflict resolution rebuild for schemas that use a composite primary key - ADD dev-mode check (SC43) to prevent encrypted fields from being nested inside other encrypted fields. When a parent path is encrypted, the entire object is encrypted so child paths must not be listed separately in the `encrypted` array. - FIX `findByIds()` query operations `modify()`, `patch()`, `incrementalModify()`, `incrementalPatch()`, and `incrementalRemove()` returning an Array instead of a Map. Also fix `findByIds().remove()` crashing with `TypeError: docs.remove is not a function` because it did not handle the Map return type from `findByIds()`. - FIX `getJsonSchemaWithoutMeta()` not removing internal meta field references (`_deleted`, `_meta.lwt`) from indexes, while correctly removing them from properties and required, causing the returned schema to be internally inconsistent - FIX `getLocal()` returning a deleted local document from the document cache instead of `null`, causing inconsistent behavior between cache hits and storage lookups after a local document is removed - FIX `replication-google-drive` plugin requesting `etag` in the Google Drive v3 list API `fields` parameter, which is rejected by the real API; etag is now fetched separately via the v2 API - FIX `RxLocalDocument.get$()` on nested object/array paths emitting spurious values when unrelated document fields changed, because `distinctUntilChanged()` used reference equality which always fails for non-primitive values across document revisions - FIX database-level `RxLocalDocument.$` observable emitting events from a collection-level local document that shares the same id, because the filter on the database event stream only checked `isLocal` and did not exclude events that originated from a collection - FIX localstorage storage `remove()` not deleting attachment data from localStorage, causing orphaned attachment entries to remain after the storage instance is removed - FIX schema migration not forwarding `_attachments` across chained migration strategies, so later strategies received the document with `_attachments` as `undefined` when an earlier strategy returned a new object without forwarding them, breaking the `WithAttachments<DocData>` contract and preventing strategies from reading or mutating attachment metadata as described in the docs - FIX schema migration losing attachments when the migration strategy returns a new object, because `migrateDocumentData()` never restored `_attachments` after running the strategies while `_meta` and `_deleted` were restored - FIX `RxMigrationState.migratePromise()` returning `count.percent: 0` instead of `100` when the migration status is `DONE` and no migration was needed, which is inconsistent with the `updateStatus()` logic that correctly sets percent to `100` when total is `0` - FIX ORM attachment-method names conflicting with built-in `RxAttachment` methods (`getData`, `getStringData`, `getDataBase64`, `remove`) not being validated, silently shadowing the built-in method on every attachment instance and preventing users from retrieving their attachment data. Dev-mode now throws a clear `RxError` (COL17) during collection creation. - FIX ORM document method names conflicting with schema-generated suffixed getters (`field$`, `field$$`, `field_`) not being validated, causing a `TypeError` crash at runtime instead of a clear `RxError` (COL18) during collection creation - FIX `RxDatabase.password` being an enumerable property, which could leak the plaintext password through `Object.keys()`, object spreading, `Object.assign()`, or `JSON.stringify()` in logging and error reporting contexts - FIX `RxPipeline` error state blocking unrelated reads on the destination collection, because the pipeline's `waitBeforeWriteFn` hook always called `awaitIdle()` which re-throws the stored handler error forever. After a handler throws, reads on the destination collection now proceed normally instead of re-throwing the pipeline error. - FIX `RxPipeline` deadlock when multiple pipelines share the same destination collection and their handlers read from the destination, because each pipeline's `waitBeforeWriteFn` only recognized its own flagged function name in the stack instead of any pipeline's flagged function prefix - FIX `RxDocument.populate()` throwing `DOC6` for array fields when `ref` is defined on `items` instead of on the array field itself, even though `createRxSchema` accepts both patterns - FIX `RxDocument.populate()` silently returning `null` for invalid schema paths and non-ref fields when the value at that path was falsy. The documented `DOC5` / `DOC6` errors are now thrown consistently, regardless of whether the document has a value at the given path. - FIX `populate()` on array ref fields returning documents in wrong order when two documents reference the same set of IDs in different order, because `findByIds` query cache deduplication reused a cached query whose Map iteration order matched the first caller instead of preserving each document's own ref array order - FIX query-builder operators (`gt`, `lt`, `ne`, `in`, etc.) silently dropping the implicit `$eq` condition when a selector shorthand value (e.g. `{ age: 5 }`) was used and then another operator was chained on the same field via the query-builder API - FIX default cache replacement policy not evicting executed unsubscribed queries when subscribed queries caused the total cache size to exceed `tryToKeepMax`, because the eviction count was calculated from only the unsubscribed query count instead of the total cache size - FIX React hooks `useRxQuery` and `useLiveRxQuery` initializing `loading` state as `false` instead of `true`, causing components to briefly render with empty results before the query resolved [#8292](https://github.com/pubkey/rxdb/pull/8292) - FIX remote storage `remove()` not unsubscribing from internal subscriptions and not completing the `changeStream()` observable, unlike `close()` which correctly performs both cleanup steps - FIX replication upstream marking documents as successfully pushed when the replication is paused during a push retry, because `masterWrite()` returns an empty conflicts array on pause and the upstream updates the meta instance and checkpoint without verifying the push actually succeeded, causing those documents to never be retried on resume - FIX replication `sent$` observable emitting documents in the master format (with the user-defined `deletedField`) instead of the typed `WithDeleted<RxDocType>` format (with `_deleted: boolean`), because the `deletedField` swap mutated the same row object that was later forwarded to subscribers - FIX replication `sent$` observable emitting `null` for documents that were filtered out by a `push.modifier` returning `null`, violating its `Observable<WithDeleted<RxDocType>>` type and falsely reporting filtered documents as sent to the endpoint - FIX RxState `_cleanup()` not returning `true` on completion, causing the cleanup plugin loop to never terminate and run indefinitely - FIX RxState `$` observable emitting duplicate and stale values on each write because both `_ownEmits$` and `collection.eventBulks$` triggered emissions for own-instance events - FIX `RxState.get$()` (and the `field$` proxy accessor) emitting a stale value when subscribed after the state was modified, because `startWith()` eagerly captured the current value at observable creation time instead of at subscription time - FIX(types) `RxDocument.collection` losing the `Reactivity` generic because it was passed as the third type argument to `RxCollection` (which is `StaticMethods`) instead of the fifth, causing `doc.collection.find().$$` and similar calls to be typed as the default reactivity instead of the user's custom reactivity type - FIX `RxDocument.$` observable emitting stale document state when subscribed after the document was modified, because `startWith()` eagerly captured the latest data at observable creation time instead of at subscription time - FIX `RxState.set()` permanently breaking the write queue when a user-supplied modifier throws, causing all subsequent `set()` calls to reject with an unrelated `SNH` error instead of performing the write - FIX storage `query()` returning all matching documents when the caller passes `limit: 0` in the mango query, because the truthy check `query.limit ? query.limit : Infinity` treated `0` as "no limit was set" (affects memory, dexie, localstorage, foundationdb, denokv, sqlite-trial, mongodb storages and the query-builder plugin). - FIX `getStartIndexStringFromLowerBound()` and `getStartIndexStringFromUpperBound()` using space character (`\x20`) as the minimum boundary for string index fields, causing documents with string values containing control characters (codepoints below 32, e.g. `\t`, `\n`) to fall below the index scan range and be silently excluded from query results and counts - FIX WebMCP `changes` tool returning documents with internal meta fields (`_meta`, `_rev`, `_attachments`, `_deleted`) instead of stripping them like the query, insert, upsert, and delete tools do via `toJSON()` # ### RxDB Server - FIX invalid CORS response when the server is configured with the default `cors: '*'`. The express adapter always sends `Access-Control-Allow-Credentials: true`, but combining that with `Access-Control-Allow-Origin: *` is rejected by browsers per the CORS spec, so credentialed (cookie/auth-header) requests from any cross-origin client would fail. The adapter now reflects the request `Origin` back when `cors` is `'*'`, keeping the "allow from anywhere" semantics while staying compatible with credentials. - FIX false conflicts during replication push when a `serverOnlyField` is absent from the stored server document (e.g. because the field is optional and was never set). `mergeServerDocumentFieldsMonad` previously wrote a `null` value for the missing field onto the merged `assumedMasterState`, so the extra key caused `masterWrite`'s `isEqual` check to report a conflict that did not actually exist, silently reverting the client's update. The helper now deletes the property in that case so the merged row matches the stored master state. - FIX replication pull URL not URL-encoding the checkpoint `id`. When a document's primary key contained URL-reserved characters (for example `&`, `#`, `=`), the URL was parsed incorrectly on the server, causing the checkpoint to be truncated. With `batchSize: 1` this could make the pull loop never advance past such a document. The client now encodes the `id` with `encodeURIComponent`. - FIX replication `/push` endpoint allowing clients to populate `serverOnlyFields` when inserting NEW documents. `mergeServerDocumentFieldsMonad` returned the client document unchanged when no server-side document existed yet, so a client-supplied value for a server-only field was passed through to `replicationHandler.masterWrite()` and persisted on the server. The merge now strips server-only fields from the client document when the server has no prior state for it, matching the documented contract that clients cannot do writes where one of the `serverOnlyFields` is set. The REST `/set` endpoint already stripped these fields explicitly, so it was unaffected. - FIX conflict handling for new documents pushed via replication when `serverOnlyFields` are configured. `mergeServerDocumentFieldsMonad` incorrectly transformed a falsy `assumedMasterState` (used for new document inserts) into an object and set server-only fields to `null` on `newDocumentState`, causing schema validation failures and false conflicts. - FIX replication `/push` endpoint allowing clients to populate `serverOnlyFields` when inserting NEW documents. Updates of existing documents already preserved the stored server value via `mergeServerDocumentFields`, but inserts (no `assumedMasterState` / no existing serverDoc) passed the client document straight into `masterWrite`, so any value the client sent for a server-only field was persisted. The handler now strips server-only fields from the new document state on insert, matching the behavior of the REST `/set` endpoint and the documented contract that clients cannot do writes where one of the `serverOnlyFields` is set. - FIX missing `await` in `RxRestClient.get()`, `RxRestClient.set()`, and `RxRestClient.delete()` methods. The `postRequest()` call was not awaited before calling `handleError()`, which caused server errors (e.g. 403 Forbidden from `changeValidator`) to be silently swallowed instead of thrown to the caller. - FIX REST client `observeQuery` not URL-encoding the base64 query string. Standard base64 contains `+` and `/`; in a URL query parameter `+` is decoded by the server as a space, so the server's `atob` rejected the corrupted string with `Invalid character` and the SSE handler crashed silently after the response headers were already sent. Any query whose base64 contained `+` or `/` (for example, queries that filtered by a unicode value such as `firstName: { $eq: 'ûÿþ' }`) would never deliver a document and the client just hung. The base64 is now passed through `encodeURIComponent` before being appended to the URL. - FIX REST `/delete` endpoint returning 403 Forbidden when `serverOnlyFields` is configured. The delete handler passed full documents (including server-only fields) to the `changeValidator`, which always rejected them because the wrapper checks for the presence of server-only fields. Now the server-only fields are stripped before validation, consistent with the `/set` endpoint behavior. - FIX REST `/query/observe` endpoint not rejecting `$regex` queries with a proper 400 response. The `queryModifier` wrapper throws on `$regex` selectors to prevent DOS attacks (matching the `/query` behavior), but the observe handler called the wrapped modifier AFTER `setSSEHeaders` had already committed a 200 OK SSE response, and without a `try/catch`. A client that sent a `$regex` query therefore observed a successful 200 status with an empty stream that the server then dropped, instead of the same 400 Bad Request that `/query` returns. The handler now runs the queryModifier (and the JSON/base64 query parsing) inside a `try/catch` BEFORE setting the SSE headers, so a bad request is answered with a proper 400 response. - FIX REST `/set` endpoint not running the `changeValidator` for inserts of NEW documents. The handler only invoked the validator on the update path (when an existing document was found by primary key), so a `changeValidator` that returned `false` had no effect when the client sent a document whose primary key did not yet exist on the server. The handler now runs the validator for inserts as well, with `assumedMasterState` set to `undefined`, matching the behavior of the replication `/push` endpoint and the documented contract that the validator gates all writes. - FIX REST `/set` endpoint allowing a client to overwrite documents they do not own. When a `queryModifier` was configured, the handler only validated that the client-provided (new) document state matched the modifier but never checked the existing server document. An authenticated user could therefore take over a foreign document by sending a write whose new state matched the modifier while targeting another user's primary key. The handler now also runs the query matcher against the existing server document and rejects the request with 403 Forbidden if it does not match, aligning the behavior with the replication `/push` endpoint. - FIX REST endpoint `/set` allowing clients to populate `serverOnlyFields` when inserting NEW documents. Updates to existing documents already stripped client-supplied values for these fields, but the insert path passed the client document straight to `RxCollection.insert()`, so a client could persist arbitrary values into fields that are documented as server-only. The handler now strips server-only fields from the client document before inserting, matching the documented contract that clients cannot do writes where one of the `serverOnlyFields` is set. - FIX REST endpoint `/set` not protecting `serverOnlyFields` from client overwrites. Clients could include server-only fields in write requests to `/set`, and those values would be stored directly instead of being ignored. The handler now uses `mergeServerDocumentFields` (consistent with the replication endpoint) to ensure server-only field values are always preserved from the server-side document, not taken from client input. ### 17.1.0 (2 April 2026) - FIX Key-compression dropping the `index` hint from queries because `compressQuery()` does not forward the `index` field, causing user-specified index hints to be silently ignored - FIX CRDT plugin `bulkInsert` hook not including schema default values in CRDT operations, causing data loss during conflict resolution rebuild when fields rely on schema defaults - FIX `RxDocument.get$()` on nested object/array paths emitting spurious values when unrelated document fields changed, because `distinctUntilChanged()` used reference equality which always fails for non-primitive values across document revisions - FIX `incrementalUpsert()` throwing a CONFLICT error when a concurrent `upsert()`/`insert()` creates the same document between the internal `findOne()` and `insert()` calls - FIX `upsertLocal()` on a previously removed local document keeping the document in deleted state instead of un-deleting it - FIX push-only replication losing local writes that occur during a pause because `reSync()` events were filtered out when no pull handler was configured - FIX `getStartIndexStringFromUpperBound()` incorrectly mapping `INDEX_MIN` to `'1'` for boolean index fields, causing queries with exclusive bounds (`$gt`/`$lt`) on a field preceding a boolean index field to include boundary documents in the results - FIX leader-election plugin not calling `die()` on the LeaderElector when the database is closed, because `LEADER_ELECTORS_OF_DB` was never populated due to a dead code branch - FIX encryption plugin schema transformation not correctly handling nested dot-notation encrypted paths (e.g. `'nested.field'`), causing validation failures when using a validator storage with non-string nested encrypted fields - FIX dev-mode `checkSchema()` not validating composite primary key fields for encryption (SC15), index (SC13), unique (SC14), and type (SC16) constraints because it compared property names against the primaryKey object instead of resolving the primary field path - FIX `findOne().remove()` crashing with `TypeError: Cannot read properties of null` when no document matches the query, instead of returning `null` - ADD `findOne().remove(true)` to throw when no document matches, consistent with `findOne().exec(true)` - FIX schema migration losing `_deleted` state when migration strategy returns a new object, causing deleted documents to be resurrected after migration - FIX `RxPipeline.remove()` not properly cleaning up checkpoint when called during active processing, causing a re-added pipeline with the same identifier to skip already-processed documents instead of starting fresh - FIX cleanup plugin prematurely exiting its retry loop when `storageInstance.cleanup()` returns `false` (batched cleanup), because `Array.find()` returns the found value `false` and `!false` evaluates to `true`, causing `isDone` to be set incorrectly - FIX encryption plugin `validatePassword()` leaking the plaintext password in `RxError` parameters and error messages when password validation fails - FIX `database.remove()` not calling collection `onRemove` handlers, because `close()` unsubscribed all listeners before the remove operation could trigger them - FIX query-builder `eq()`/`equals()` silently overwriting other operator conditions on the same field because the value was stored as a raw primitive instead of using the `$eq` operator form - FIX `deleted$` observable emitting on every document revision instead of only when the deleted state changes, by adding `distinctUntilChanged()` - FIX `postSave` collection hook not receiving the RxDocument instance as the second argument, unlike `postInsert` and `postRemove` which correctly pass it - FIX `getJsonSchemaWithoutMeta()` not removing `_rev` from schema properties, while correctly removing other internal meta properties (`_deleted`, `_meta`, `_attachments`) - FIX `allAttachments$` observable emitting attachments with a stale document reference, causing `attachment.doc` to point to an outdated document version instead of the latest one - FIX RxState not correctly recovering full-state replacements (via `set('', modifier)`) from disk on database reopen, causing corrupted state - FIX memory storage `count()` returning incorrect results when the selector is not fully satisfied by the index and the query has a `limit` set - FIX `replicateRxCollection().remove()` on a never-started replication now creates the meta instance and deletes its data instead of skipping cleanup - FIX `REPLICATION_STATE_BY_COLLECTION` not cleaned up on `cancel()`/`remove()`, leaking replication state references - FIX floating-point rounding overflow in index string decimal generation, where `Math.round` could produce a value equal to the multiplier (e.g. 10 instead of max 9), creating a string one character too long and breaking sort order in compound indexes - FIX `normalizeMangoQuery()` skipped fully-matching indexes when choosing default sort order, falling back to the first index instead of using the best match - FIX RxState `set('', modifier)` passed `undefined` to the modifier instead of the current state - FIX `RxMigrationStatus.count.percent` returning `NaN` instead of `100` when migrating a collection with 0 documents - FIX `fillWithDefaultSettings()` index deduplication was broken because `Array.filter()` return value was discarded, causing duplicate indexes in schemas when user-defined indexes become identical after adding `_deleted` prefix and primary key suffix - FIX encryption plugin not stripping type-specific schema keywords (`maxLength`, `required`, `items`, etc.) from encrypted fields, causing validation errors when using a validator storage with encryption - FIX incorrect index string generation for negative decimal numbers causing wrong sort order and query results - FIX `rateQueryPlan()` evaluated `startKeys` twice instead of `endKeys`, causing suboptimal index selection for `$lt`/`$lte` queries. - FIX event-reduce mutating cached `docsDataMap` causing missing documents after insert-delete cycles - FIX `modify()` not deep-cloning document data, allowing the modifier to corrupt internal state via shared nested references - FIX `fillObjectWithDefaults` shared mutable references for non-primitive schema defaults (arrays/objects) causing corrupted values on subsequent inserts ### 17.0.0 (30 March 2026) 🚀 **RxDB v17 is released** - A list of changes for RxDB v17 can be found [here](https://rxdb.info/releases/17.0.0.html) ### 16.21.1 (2 December 2025) - feat: replication-supabase querybuilder [#7566](https://github.com/pubkey/rxdb/pull/7566) - FIX Array type is omitted in GraphQL query builder [#7532](https://github.com/pubkey/rxdb/issues/7532) ### 16.21.0 (25 November 2025) - FIX(docs) search visibility and positioning - ADD(storage-localstorage) attachment support. - FIX error in dev mode when writing object with no prototype [#7530](https://github.com/pubkey/rxdb/pull/7530) - FIX findOne subscription + exec returns wrong results [#7497](https://github.com/pubkey/rxdb/pull/7497) - FIX(supabase-replication) push.modifier is not used [#7513](https://github.com/pubkey/rxdb/issues/7513) ### 16.20.0 (20 October 2025) - FIX(types) pull handler can return `undefined` as checkpoint. - FIX Issue running rxdb dev mode plugin on latest react native [#7421](https://github.com/pubkey/rxdb/issues/7421) - DOCS add info about non allowed top level properties [#7449](https://github.com/pubkey/rxdb/issues/7449) ### 16.19.1 (24 September 2025) ### 16.19.0 (4 September 2025) - ADD [Supabase Replication Plugin](https://rxdb.info/replication-supabase.html) (beta) ### 16.18.0 (26 August 2025) - FIX "when a push handler is interrupted mid-way by a reload, after the reload retry doesn't happen" [via discord](https://discord.com/channels/969553741705539624/1059149217718861935/threads/1407063219062702111) - FIX query hanging after local document inserted [#7349](https://github.com/pubkey/rxdb/pull/7349) - FIX(sqlite-storage) query $or with null returns wrong results [#7356](https://github.com/pubkey/rxdb/issues/7356) ### 16.17.2 (15 August 2025) - FIX credentials header in RxServer [#283](https://github.com/pubkey/rxdb-server/pull/283) ### 16.17.1 (15 August 2025) - UPDATE express to v5 in RxServer ### 16.17.0 (13 August 2025) - ADD `blockSizeLimit` to memory mapped storage. - FIX cleanup of a collection must also run the cleanup of the meta data of replications. - FIX type of SimplePeerConnectionHandlerOptions.webSocketConstructor [#7311](https://github.com/pubkey/rxdb/pull/7311) ### 16.16.0 (16 July 2025) - FIX updates not working after migration of replication state [#7260](https://github.com/pubkey/rxdb/issues/7260) - FIX on ReplicationState.pause(), `ensureNotFalsy()` throws [#7264](https://github.com/pubkey/rxdb/issues/7264) ### 16.15.0 (17 June 2025) - ADD option to remove and update a document in the same atomic write operation. - ADD option to disable `WITHOUT ROWID` in the SQLite RxStorage. - FIX ajv-validation must know about the `date-time` format by default [#7253](https://github.com/pubkey/rxdb/issues/7253) - FIX db.addCollections fails after it failed for a missing migration strategy [#7226](https://github.com/pubkey/rxdb/pull/7226) - FIX SQLite storage fails while querying with null [#7236](https://github.com/pubkey/rxdb/pull/7236) ### 16.13.0 (30 May 2025) - FIX queue start/stop/cancel operations in the replication state to ensure operations do not intersect and cause errors. - FIX real-time query ignoring the latest changes after deleting and purging data [#7187](https://github.com/pubkey/rxdb/pull/7187) - ADD `putAttachmentBase64()` and `getDataBase64()` to the attachments API so that attachments can be stored and read in runtimes that do not support `Blob`. - FIX schema migration failing when returning null [#7204](https://github.com/pubkey/rxdb/pull/7204) ### 16.12.0 (10 May 2025) - FIX migration-schema error: "more then one meta info found". - FIX state get changes from other state will get error [#7097](https://github.com/pubkey/rxdb/pull/7097) - FIX toggleOnDocumentVisible isVisible not always truthy [#7095](https://github.com/pubkey/rxdb/pull/7095) - IMPROVE error message when `crypto.subtle.digest` is not defined. ### 16.11.0 (16 April 2025) - FIX MigrationStrategies type not generic [#7055](https://github.com/pubkey/rxdb/pull/7055) - FIX Full text search ajv validation issue [#4](https://github.com/pubkey/rxdb-premium-issues/pull/4) - Full text search with encryption issue [#5](https://github.com/pubkey/rxdb-premium-issues/pull/5) - Published the [Appwrite Replication Plugin](https://rxdb.info/replication-appwrite.html) in beta mode - UPDATE the `ws` package to the latest version. ### 16.9.0 (1 April 2025) - ADD [Localstorage RxStorage](https://rxdb.info/rx-storage-localstorage.html). - ADD docs about [Partial Sync](https://rxdb.info/replication.html#partial-sync-with-rxdb). - ADD SQLite Storage example with tauri [#6939](https://github.com/pubkey/rxdb/pull/6939). - ADD `closeDuplicates` flag as alternative to `ignoreDuplicate` to `createRxDatabase` [#7013](https://github.com/pubkey/rxdb/pull/7013). - FIX (electron) "Object has been destroyed" error was introduced again in RxDB version 16 [#5370](https://github.com/pubkey/rxdb/issues/5370#issuecomment-2748971414). - FIX Memory-mapped storage can have duplicate documents if a write happens during cleanup. - FIX migrate schema with multiple connected storages causes error [#7008](https://github.com/pubkey/rxdb/pull/7008) ### 16.8.1 (14 March 2025) - FIX col.find() ignores the primaryKey index if another index was defined [#6925](https://github.com/pubkey/rxdb/pull/6925) ### 16.8.0 (3 March 2025) - Add a free trial version of the [SQLite RxStorage](https://rxdb.info/rx-storage-sqlite.html) - Add article about [Why Local-First Software Is the Future and its Limitations](https://rxdb.info/articles/local-first-future.html) ### 16.7.0 (23 February 2025) - Fix Firestore replication ignoring initialCheckpoint [#6850](https://github.com/pubkey/rxdb/pull/6850) - UPDATE foundation-db to the latest version [#6876](https://github.com/pubkey/rxdb/pull/6876) - ADD Allow to use firestore rules on attributes [#6896](https://github.com/pubkey/rxdb/pull/6896) ### 16.6.1 (9 February 2025) ### 16.6.0 (7 February 2025) - FIX FilesystemNode storage imported stuff from the IndexedDB storage which could break builds. - FIX [broken cjs import on the flexsearch plugin](https://discord.com/channels/969553741705539624/1333530507215900692) ### 16.5.0 (4 February 2025) - ADD option `toggleOnDocumentVisible` to `replicateRxCollection()`. [See](https://github.com/pubkey/rxdb/issues/6810) - ADD `RxReplicationState.pause()` - ADD `RxReplicationState.isPaused()` - ADD tests to replication to ensure running the same replication in multiple tabs at once does not fail. ### 16.4.0 (1 February 2025) - ADD option to set custom formats in the [schema validators](https://rxdb.info/schema-validation.html) - CHANGE enable Ajv strict mode. - REMOVE `console.log('exposeWorkerRxStorage()');` from the worker RxStorage. - ADD dev-mode check for `undefined` properties in queries. [#6792](https://github.com/pubkey/rxdb/issues/6792) ### 16.3.0 (22 January 2025) - Run the check for `maxLength` on primary keys also in non-dev mode because people often forget to set this. - Make error messages prettier and more readable. ### 16.2.0 (16 January 2025) - ADD `RxCollection.insertIfNotExists()` - Allow uppercase chars at the middle of collection names like `fooBar`. - FIX RxServer to not have `process is not defined` [#6764](https://github.com/pubkey/rxdb/issues/6764) ### 16.1.0 (11 January 2025) - Include RxDB version details in MongoDB handshake [#6722](https://github.com/pubkey/rxdb/pull/6722) - ADD Allow connectionParams to be provided as part of wsOptions for replication-graphql [#6741](https://github.com/pubkey/rxdb/pull/6741) ### 16.0.0 (2 January 2025) 🚀 **RxDB v16 is released** - A list of changes for RxDB v16 can be found [here](https://rxdb.info/releases/16.0.0.html) ### 15.39.0 (21 November 2024) - FIX bulkInsert with primary keys set in preInsert hook broken in v15.38.3 [#6608](https://github.com/pubkey/rxdb/pull/6608) - ADD possibility to pass graphql-ws options into the replication options [#6598](https://github.com/pubkey/rxdb/pull/6598) ### 15.38.3 (18 November 2024) - FIX findByIds not working with modify and patch [#6592](https://github.com/pubkey/rxdb/pull/6592) - FIX bulk inserting 2 docs with same primary key should throw [#6589](https://github.com/pubkey/rxdb/pull/6589) ### 15.38.2 (14 November 2024) - CHANGE use variable random string lengths in the tests to ensure this works. ### 15.38.1 (13 November 2024) - FIX random string creation in tests could end up with strings longer than the provided `length` ### 15.38.0 (13 November 2024) - FIX bad RxState after cleanup [#6503](https://github.com/pubkey/rxdb/pull/6503) - FIX RxServer cors settings only applies to OPTIONS when using ExpressAdapter [#6523](https://github.com/pubkey/rxdb/issues/6523) - ADD random emojis and umlauts to all random strings in the tests to ensure this works correctly. - REMOVE faker dependency for tests and instead use random strings with emojis and umlauts. - ~FIX [OPFS RxStorage](https://rxdb.info/rx-storage-opfs.html) not working anymore after a cleanup has run on documents with umlauts in the primaryKey or index fields.~ ⬅️ This has been moved to RxDB v16 because it would be a breaking change. ### 15.37.0 (5 November 2024) - FIX position of dev-mode iframe [#6516](https://github.com/pubkey/rxdb/pull/6516) - FIX `$nin` queries not working correctly with the SQLite RxStorage - FIX (worker storage) when creating the same database in the worker and on the main thread, the main thread never resolves. [via discord](https://discord.com/channels/969553741705539624/1296068420311187518) ### 15.36.1 (16 October 2024) - ADD SQLite RxStorage support for Expo SDK 51 with the async API `getSQLiteBasicsExpoSQLiteAsync()` ### 15.36.0 (16 October 2024) - ADD option to define the RxDB Premium token in an `.env` file ### 15.35.0 (15 October 2024) - 🆕📢 New Article: [LocalStorage vs. IndexedDB vs. Cookies vs. OPFS vs. WASM-SQLite](https://rxdb.info/articles/localstorage-indexeddb-cookies-opfs-sqlite-wasm.html) - FIX RxState.property$ should emit stable reference [#6462](https://github.com/pubkey/rxdb/pull/6462) ### 15.34.1 (2 October 2024) - ADD proper error message if people miss out the `usesRxDatabaseInWorker` settings in OPFS. ### 15.34.0 (1 October 2024) - FIX OPFS Storage based RxDatabase cannot be created inside of worker [via discord](https://discord.com/channels/969553741705539624/1290258375359336549) - IMPROVE performance of nested property access [#6406](https://github.com/pubkey/rxdb/pull/6406) - FIX firestore replication of multiple document with the same serverTimestamp [#6436](https://github.com/pubkey/rxdb/pull/6436) ### 15.33.0 (10 September 2024) - ADD tutorial for a [local-first Vector Database](https://rxdb.info/articles/javascript-vector-database.html) - FIX RxPipeline tries to store metadata that does not match the json schema. - ADD utilities function for vector search. ### 15.32.0 (26 August 2024) - ADD [Fulltext Search Plugin](https://rxdb.info/fulltext-search.html) - FIX `RangeError: Invalid count value` error in the OPFS and filesystem storage on cleanups. ### 15.31.4 (22 August 2024) ### 15.31.3 (21 August 2024) ### 15.31.2 (21 August 2024) - FIX `postCleanup` hook not running ### 15.31.1 (19 August 2024) - ADD `postCleanup` hook. ### 15.31.0 (14 August 2024) - ADD [RxPipeline Plugin](https://rxdb.info/rx-pipeline.html). - FIX (denoKV RxStorage) retry writes when db is locked. ### 15.30.2 (5 August 2024) - FIX `node:sqlite` couldn't be found in react native [#6291](https://github.com/pubkey/rxdb/issues/6291) ### 15.30.1 (3 August 2024) - FIX `node:sqlite` couldn't be found in react native [#6291](https://github.com/pubkey/rxdb/issues/6291) ### 15.30.0 (2 August 2024) - FIX quotes problem on windows with the scripts of the `package.json` - CHANGE `getSQLiteBasicsNodeNative()` requires the constructor as param - FIX key-compression broken with boolean indexes on dexie [#6267](https://github.com/pubkey/rxdb/pull/6267) - FIX type of `RxQuery.$` must be `Observable` [#6285](https://github.com/pubkey/rxdb/issues/6285) ### 15.29.0 (29 July 2024) - ADD support for the `node:sqlite` module to the SQLite RxStorage - FIX several problem with the memory-mapped RxStorage in ReactNative ### 15.28.1 (19 July 2024) - ADD storage bucket support to the [IndexedDB RxStorage](https://rxdb.info/rx-storage-indexeddb.html). - FIX error when calling bulkUpsert() with multiple docs where one fails and one suceeds. ### 15.28.0 (9 July 2024) - CHANGE RxStorage interface: For better performance on remote storages, `RxStorageInstance.bulkWrite()` must only return errors, not the written documents data. ### 15.27.0 (7 July 2024) - FIX Wrong Reactivity generics passed by RxCollection extending RxCollectionBase [#6188](https://github.com/pubkey/rxdb/issues/6188) - IMPROVE performance of ChangeEventBuffer by processing events in bulks. - IMPROVE performance of DocCache by processing events in bulks. - IMPROVE performance of ChangeEventBuffer and DocCache by lazily processing tasks. ### 15.26.0 (3 July 2024) - IMPROVE performance of `.appendToArray()` - IMPROVE performance of writes to the memory RxStorage - ADD iframe tracking to dev-mode plugin. ### 15.25.0 (28 June 2024) - FIX RxState sometimes does writes to the storage that do not match the schema. - FIX Query Builder does not work on queries created by `.findByIds()` [#6148](https://github.com/pubkey/rxdb/issues/6148) - FIX (IndexedDB RxStorage) When used with Sharding and Workers, it sometimes errors on the first query after db creation. ### 15.24.0 (9 June 2024) - Opened the [RxDB User Survey 2024](https://rxdb.info/survey) - FIX rx-state multi instance observable broken [#6084](https://github.com/pubkey/rxdb/pull/6084) ### 15.23.0 (29 May 2024) - FIX type resolving in webpack [#6051](https://github.com/pubkey/rxdb/pull/6051) ### 15.22.0 (23 May 2024) - Add missing extensions error field to errorToPlainJson [#6029](https://github.com/pubkey/rxdb/pull/6029) - ADD dedicated [errors page](https://rxdb.info/errors.html) - FIX randomly failing replication test - ADD non-premium console.log on the [LokiJS RxStorage](https://rxdb.info/rx-storage-lokijs.html#disabling-the-non-premium-console-log) ### 15.21.3 (20 May 2024) - ADD publish the npm package with the [provenance statements](https://docs.npmjs.com/generating-provenance-statements) ### 15.21.0 (18 May 2024) - FIX `collection.remove()` must end up with the correct RxCollection state across tabs. [5721](https://github.com/pubkey/rxdb/issues/5721) - ADD `RxCollection.onRemove` hooks to detect the removing of a RxCollection across tabs. - IMPROVE performance of insert to [IndexedDB](https://rxdb.info/rx-storage-indexeddb.html) - ADD non-premium console.log on the [Dexie.js RxStorage](https://rxdb.info/rx-storage-dexie.html#disabling-the-non-premium-console-log) ### 15.20.0 (12 May 2024) - ADD `RxQuery.patch()` `RxQuery.incrementalPatch()` `RxQuery.modify()` `RxQuery.incrementalModify()` and `RxQuery.incrementalRemove()`. - FIX `RxDocument.update()` must return the latest revision of the `RxDocument`. - ADD(GraphQL replication) change GraphQL query builder functions to generate output fields for nested queries [#5976](https://github.com/pubkey/rxdb/pull/5976) - ADD `queryModifier` to SQLite RxStorage - IMPROVE performance of insert-many to the memory RxStorage by 40%. - IMPROVE performance of `getHeightOfRevision()`. - ADD check to throw helpfull error message when a Date() object is passed instead of plain json data. ### 15.19.0 (29 April 2024) - ADD the new [Memory-Mapped RxStorage](https://rxdb.info/rx-storage-memory-mapped.html), a better alternative for the Memory-Synced RxStorage. ### 15.18.6 (29 April 2024) ### 15.18.5 (29 April 2024) ### 15.18.4 (27 April 2024) ### 15.18.3 (25 April 2024) ### 15.18.2 (25 April 2024) - Memory RxStorage: Add `categorizedByWriteInput` property that can be used by other plugins. ### 15.18.1 (18 April 2024) - FIX CouchDB replication error `Cannot read properties of undefined (reading '_attachments')` ### 15.18.0 (17 April 2024) - FIX memory-synced storage must be able to query encrypted fields on the in-memory side. - RxServer: `updatedAt` must be `lwt` [#61](https://github.com/pubkey/rxdb-server/pull/61) - RxServer: Fix using `parseFloat` instead of `parseInt` [#5883](https://github.com/pubkey/rxdb/issues/5883) ### 15.17.0 (8 April 2024) - ADD `RxReplicationState.remove()` to delete the metadata of a specific replication. - FIX IndexedDB RxStorage: Rerun database creation when IndexedDB database was closed by [safari bug](https://bugs.webkit.org/show_bug.cgi?id=197050) - FIX vite bundling error with WebRTC replication [#5841](https://github.com/pubkey/rxdb/issues/5841) - ADD replication-webrtc: allow passing config to simple-peer [#5838](https://github.com/pubkey/rxdb/pull/5838) ### 15.16.0 (28 March 2024) - Update dexie.js to version `4.0.1` - Deprecate LokiJS RxStorage ### 15.15.1 (27 March 2024) ### 15.15.0 (27 March 2024) - ADD `PreactSignalsRxReactivityFactory` to use [custom reactivity](https://rxdb.info/reactivity.html) with **preact signals** instead of observables. - ADD `VueRxReactivityFactory` to use [custom reactivity](https://rxdb.info/reactivity.html) with **vue shallow refs** instead of observables. - ADD(reactivity) pass reference to `RxDatabase` to `fromObservable()` ### 15.14.0 (25 March 2024) - ADD [Fastify adapter to RxServer](https://rxdb.info/rx-server.html) - ADD [Koa adapter to RxServer](https://rxdb.info/rx-server.html) ### 15.13.4 (24 March 2024) ### 15.13.3 (24 March 2024) ### 15.13.2 (24 March 2024) ### 15.13.1 (24 March 2024) ### 15.13.0 (24 March 2024) - REFACTOR RxServer package. (Includes breaking changes of the beta RxServer!) ### 15.12.0 (16 March 2024) - [SQLite RxStorage](https://rxdb.info/rx-storage-sqlite.html) add support to use Webassembly SQLite in the browser - FIX(Lokisjs RxStorage) always use slice() for applying offset and limit [#5757](https://github.com/pubkey/rxdb/pull/5757) - FIX randomly failing lokijs and denokv test [#5765](https://github.com/pubkey/rxdb/pull/5765) ### 15.11.1 (10 March 2024) ### 15.11.0 (10 March 2024) - ADD [RxState](https://rxdb.info/rx-state.html): A convenient state library to store, fetch and observe complex json data that is persisted into RxDB. - ADD automatically extend the RxDocument type so it knows about the `RxDocument.myField$` observables. - ADD check to ensure `Infinity` is not used when defining index sizes in the `RxJsonSchema` - FIX do not automatically set `multiInstance: false` for shared worker storage databases. ### 15.10.0 (27 February 2024) - IMPROVE [OPFS RxStorage](https://rxdb.info/rx-storage-opfs.html) performance. - ADD `usesRxDatabaseInWorker` option to the [OPFS RxStorage](https://rxdb.info/rx-storage-opfs.html). - ADD `getRxStorageOPFSMainThread()` to run OPFS from the main thread instead of a worker for less latency. ### 15.9.1 (21 February 2024) - FIX creating two databases with the same name but different storage must work. ### 15.9.0 (21 February 2024) - ADD `awaitWritePersistence` option to memory-synced storage. ### 15.8.1 (14 February 2024) - FIX [#5624](https://github.com/pubkey/rxdb/issues/5624) Maximum call stack size exceeded during encryptString ### 15.8.0 (10 February 2024) - ADD support for [custom reactivity factories](https://rxdb.info/reactivity.html) like angular signals or vue template refs. ### 15.7.0 (7 February 2024) - FIX key-compression broken on keys with brackets [#5605](https://github.com/pubkey/rxdb/issues/5605) ### 15.6.2 (7 February 2024) - FIX using encryption plugins inside of worker was broken - FIX(premium) missing type `SharedWorker` ### 15.6.1 (1 February 2024) - FIX(lokijs) `$in` operator not working on arrays. ### 15.6.0 (1 February 2024) - FIX firestore replication not working with schema validation [#5572](https://github.com/pubkey/rxdb/issues/5572) - FIX Replication observation mode ignored when push handler is waiting [#5571](https://github.com/pubkey/rxdb/issues/5571) - FIX migration from v14 -> v15 is broken when IndexedDB is used inside of worker. [5565](https://github.com/pubkey/rxdb/issues/5565) ### 15.5.0 (30 January 2024) - ADD [RxServer](https://rxdb.info/rx-server.html) 🎉 - ADD Optionally supress dev mode Warning [#5556](https://github.com/pubkey/rxdb/issues/5556) ### 15.4.3 (28 January 2024) ### 15.4.2 (24 January 2024) - ADD(worker storage) support for directly imported `Worker` and `SharedWorker` functions as `workerInput`. ### 15.4.1 (24 January 2024) - ADD export test utilities so other projects can use them ### 15.4.0 (22 January 2024) - ADD helpers for the new server plugin - ADD `RxJsonSchema.internalIndexes` - ADD(opfs-storage) allow to set `jsonPositionSize` to increase the maxium database size to be bigger than 100 MegaByte. ### 15.3.0 (15 January 2024) - ADD tutorial on [how to start a HTTP replication with a custom server](https://rxdb.info/replication-http.html) - FIX `.count()` broken on key-compression plugin [#5492](https://github.com/pubkey/rxdb/pull/5492) - UPDATE dexie to version `4.0.1-beta.6` [#5469](https://github.com/pubkey/rxdb/pull/5469) ### 15.2.0 (5 January 2024) - FIX(dexie.js) migration from v14 to v15 not working. - ADD initialCheckpoint for Couchdb [#5461](https://github.com/pubkey/rxdb/pull/5461) ### 15.1.0 (2 January 2024) - Add `operationName` to graphQL requests [#5418](https://github.com/pubkey/rxdb/pull/5418) - Custom fetch to support axios for the graphQL replication [#5421](https://github.com/pubkey/rxdb/pull/5421) - FIX CRDT not working with undefined fields [#5423](https://github.com/pubkey/rxdb/pull/5423) ### 15.0.0 (20 December 2023) 🚀 **RxDB v15 is released** - A list of changes for RxDB v15 can be found [here](https://rxdb.info/releases/15.0.0.html) ### 14.17.1 (24 September 2023) - Ensure the test suite runs in the [bun runtime](https://bun.sh/) ### 14.17.0 (18 September 2023) - Expose path in validate-z-schema error logs [#4900](https://github.com/pubkey/rxdb/pull/4900) - ADD options for the worker storages [#4925](https://github.com/pubkey/rxdb/issues/4925) - ADD the [MongoDB RxStorage](https://rxdb.info/rx-storage-mongodb.html) ### 14.16.0 (21 August 2023) - FIX primaryKey with value "constructor", breaks findOne() - FIX Queries with `$lt` selector on primaryKey broken [#4751](https://github.com/pubkey/rxdb/pull/4751) - UPDATE [mingo](https://github.com/kofrasa/mingo) to `6.4.4` ### 14.15.1 (27 July 2023) - FIX using `.count()` with `allowSlowCount: true` can return wrong results. ### 14.15.0 (18 July 2023) - FIX count() is incorrect [#4755](https://github.com/pubkey/rxdb/issues/4755) ### 14.14.2 (10 July 2023) - FIX #4804 requestIdlePromise broken in react-native (#4813) - FIX #4781 GraphQL Replication Cancel With Database Destroy ### 14.14.1 (23 June 2023) - Fix returning deleted items in find queries [#4773](https://github.com/pubkey/rxdb/pull/4773) ### 14.14.0 (7 June 2023) - ADD [NATS replication](https://rxdb.info/replication-nats.html) ### 14.13.0 (2 June 2023) - Add new hooks in the replication write [#4754](https://github.com/pubkey/rxdb/pull/4754) - REFACTOR(docs) [quickstart page](https://rxdb.info/quickstart.html) - REFACTOR(docs) [landing page](https://rxdb.info/) ### 14.12.1 (30 May 2023) - Fix prevent delete _rev from row.doc [#4752](https://github.com/pubkey/rxdb/pull/4752) - IMPROVE landingpage hero section [#4753](https://github.com/pubkey/rxdb/pull/4753) ### 14.12.0 (23 May 2023) - FIX(couchdb replication) Retries must respect `retryTime` to not cause the UI to stuck [related #4612](https://github.com/pubkey/rxdb/pull/4612) - FIX(OPFS RxStorage) various bugs with umlauts - REMOVE outdated tests [related #4741](https://github.com/pubkey/rxdb/pull/4741) - FIX checkSchema for anyOf and items array [#4741](https://github.com/pubkey/rxdb/pull/4741) ### 14.11.5 (19 May 2023) ### 14.11.4 (17 May 2023) ### 14.11.3 (16 May 2023) ### 14.11.2 (15 May 2023) ### 14.11.1 (4 May 2023) - FIX remove `pouchdb-selector-core` dependency [#4722](https://github.com/pubkey/rxdb/issues/4722) ### 14.11.0 (26 April 2023) - ADD Links to [RxDB User Survey 2023](https://rxdb.info/survey.html) - FIX better support for as const schemas [#4686](https://github.com/pubkey/rxdb/pull/4686) ### 14.10.0 (25 April 2023) - ADD [Filesystem Node RxStorage](https://rxdb.info/rx-storage-filesystem-node.html) ### 14.9.0 (20 April 2023) - ADD [attachment compression plugin](https://rxdb.info/rx-attachment.md#attachment-compression) - REFACTOR Use custom `appendToArray()` instead of slow `Array.concat()` ### 14.8.3 (16 April 2023) - FIX(data-migrator) use `count()` instead of `query()` to count documents. - FIX(data-migrator) send correct `writeRow.previous` to old storage for deletion. ### 14.8.2 (15 April 2023) ### 14.8.1 (15 April 2023) ### 14.8.0 (15 April 2023) - FIX(docs) `eventReduce: false` is the default