Releases: realm/realm-js
Releases · realm/realm-js
Realm JavaScript v2.26.0
Enhancements
- Add 4 new fields to
NamedSubscription
which reprents query-based subscriptions:createdAt
,updatedAt
,expiresAt
andtimeToLive
. These make it possible to better reason about and control current subscriptions. (#2266) - Add the option of updating the query controlled by a subscription using either
Results.subscribe({name: 'name', update: true})
or theNamedSubscription.query
property. (#2266) - Add the option of setting a time-to-live for subscriptions using either
Results.subscribe({name: 'name', timeToLive: <valueInMs>})
or theNamedSubscription.timeToLive
property. (#2266) - Add
Realm.Results.description()
which returns a string representation of the query. - Add support for defining mapped properties in the schema using
name: { type: 'int', mapTo: 'internalName' }
. In that case the mapped name is used internally in the underlying Realm file, while the property key is used for reading/writing the property as well as querying it. - Add
RealmObject.addListener()
,RealmObject.removeListener()
, andRealmObject.removeAllListeners()
to set up and remove object-level notifications. (#763) - Add a new
Realm.UpdateMode
enum with the values:never
,modified
,all
. This replaces the current
Realm.create(type, properties, update)
withRealm.create(type, properties, updateMode)
.
Realm.create(type, properties, 'modified')
is a new mode that only update existing properties that actually
changed, whileRealm.create(type, properties, 'never')
is equal toRealm.create(type, properties, false)
and
Realm.create(type, properties, 'all')
is equal toRealm.create(type, properties, true)
.
Realm.create(type, properties, update)
is now deprecated. (#2089)
Fixed
- Fixed retrying authentication requests. The issue could be observed as "Cannot read property 'get' of undefined." errors being thrown when the authenticate requests were retried. (#2297, since v2.24.0)
- Due to a rare race condition in some Android devices (including Samsung SM-T111), an app could crash hard. A workaround was introduced but never included in any releases. (#1895, since v2.11.0)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Realm JavaScript v2.25.0
Enhancements
- Added
Realm.Sync.setLogger()
to capture the sync client's log. (#2125 and realm-js-private#517)
Fixed
- Fixed broken user auth functions when running in electron. (#2264, since v2.24.0)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Realm JavaScript v2.24.0
Enhancements
- Add support for React Native v0.58. (#2239)
Fixed
- Fixed an assertion failure when using a synchronized Realm and an object was created after another object was created with an int primary key of
null
. (#3227) - When debugging with React Native, calling
Realm.open()
would crash sinceRealm._asyncOpen()
was not available in the debugger. (#2234, since v2.20.0) - Added several missing functions to the Chrome debugging support library. (#2242, since v2.2.19).
- Fixed incorrect results when reading data from Realm from within a callback function when debugging in Chrome. (#2242).
- Report the correct user agent to the sync server rather than always "RealmJS/Unknown". (#2242, since v2.23.0).
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Realm JavaScript v2.23.0
Enhancements
- Added
Realm.copyBundledRealmFiles()
to TypeScript definitions. (#2176) - The parser now supports readable timestamps with a
T
separator in addition to the originally supported@
separator. For example:startDate > 1981-11-01T23:59:59:1
. (realm/realm-core#3198) - It is now possible to store Realms on Android external storage with React Native by using
Realm.Configuration.fifoFilesFallbackPath
. (#2062) - New global notifier API introduced though
Realm.Sync.addListener(config, event, callback)
. This also adds support for configuring the SSL connection. The old APIRealm.Sync.AddListener(serverUrl, adminUser, filterRegex, event, event, callback)
is deprecated. (#2243)
Fixed
- Realm initialized the filesystem when being imported instead of waiting for the first Realm to be opened. ([#2218] (#2218), since v2.22.0)
- Sync sessions for Realms which were closed while the session was paused would sometimes not be cleaned up correctly. (realm/realm-object-store#766, since v2.16.0)
- Querying Realm instances obtained from
Realm.Sync.Adapter
would sometimes pin the read transaction version, resulting in the file rapidly growing in size as further transactions were processed. (realm/realm-object-store#766, since v2.0.2)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Realm JavaScript v2.22.0
This release contains all changes from v2.22.0-beta.1 to v2.22.0-beta.2.
Enhancements
- Calling
Realm.Sync.User.createConfiguration()
now supports a relative URL which will use the Authentication server as base url. (#1981) - Updated React Native Android Builds to use Android Build Tools 3.2.1. (#2103)
- Improved performance and memory usage of
Realm.Sync.Adapter
. (realm/realm-js-private#501) - When an invalid/corrupt Realm file is opened, the error message will now contain the file name. (realm/realm-core#3203)
Fixed
Realm.Sync.User.createConfiguration()
created an extra:
if no port was defined. (#1980, since v2.8.0)- A slower fallback solution for system which does not support
posix_fallocate()
. - Fixed building on Android. (#2189, since v2.22.0-beta.2)
- Fix an occasional crash due to an uncaught
realm::IncorrectThreadException
when a client reset error occurs. (#2193#2193) - When a sync worker is called with no arguments, a runtime error can occur. Thanks to @radovanstevanovic. (#2195, since v2.2.2)
- Fix an occasional crash due to an uncaught
realm::IncorrectThreadException
when a client reset error occurs. (#2193) - A crash bug could be triggered in some situations by creating, deleting, then recreating tables with primary keys. This could be seen observed as a crash with the message
Row index out of range.
(realm/realm-sync#2651, since v2.0.0)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Internal
- Upgraded to Realm Core v5.12.7.
- Upgraded to Realm Sync v3.14.12.
- Upgraded to https://github.com/nlohmann/json 3.4
2.22.0-beta.2
Important
This release does not work on Android!
Enhancements
- Improved performance and memory usage of
Realm.Sync.Adapter
.
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Internal
- Upgraded to https://github.com/nlohmann/json 3.4
2.22.0-beta.1
Enhancements
- Calling
Realm.Sync.User.createConfiguration()
now supports a relative URL which will use the Authentication server as base url. (#1981) - Updated React Native Android Builds to use Android Build Tools 3.2.1. (#2103)
Fixed
Realm.Sync.User.createConfiguration()
creating an extra:
if no port was defined. (#1980, since v2.8.0)- On AWS Lambda we may throw an
Operation not permitted
exception when calling posix_fallocate(). (#1832, since v0.10.0)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
2.21.1
Enhancements
- None.
Fixed
- ReactNative for Android no longer uses deprecated methods and can build using Gradle 5.0 and above. (#1995)
- A bug caused loading the binary component of the SDK to hang on Windows. (#2169, since v2.21.0)
- Fix occasional
FATAL ERROR: v8::String::Cast Could not convert to string
crashes when reading a property from a Realm object. (#2172, since v2.19.0) - Reverted support for
n
as it prevents users to include Realm in iOS apps. We restore the old behaviour as a temporary solution, and we will reenable support ofn
in the near future. (#2099, since v2.19.0-rc.5)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Internal
- Upgraded to Realm Core v5.12.5 (hanging on Windows).
- Upgraded to Realm Sync v3.14.3.
v2.21.0
Enhancements
- Adds support for
Realm.Sync.reconnect()
that will attempt to reconnect to the server immediately if the device has been offline.
Fixed
- Fixed a bug that prevented admin token users from being properly deserialized when calling
User.deserialize
. (#2155, since v2.16.0) _initializeSyncManager
missing when debugging React Native in Chrome. Resulted in messages likerealmConstructor.Sync._initializeSyncManager is not a function
(#2128, since v2.20.0)- The
LIMIT
predicate on query-based sync Realms will now be evaluated after the permission check instead of before. Sometimes the predicates would not get all the objects matched. - An index out of range error in query-based sync is fixed. The bug would manifest itself with a
list ndx out of range
assertion. - If encryption was enabled, decrypted pages were not released until the file was closed, causing excessive usage of memory.
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Internal
- Upgraded to Realm Core v5.12.3 (releasing decrypted pages).
- Upgraded to Realm Sync v3.14.1 (
LIMIT
and out-of-range).
v2.20.0
Enhancements
- Adds support for setting a custom User-Agent string using
Realm.Sync.setUserAgent(...)
. This string will be sent to the server when creating a connection. (#2102) - Adds support for uploading and downloading changes using
Realm.Sync.Session.uploadAllLocalChanges(timeout)
andRealm.Sync.Session.downloadAllRemoteChanges(timeout)
. (#2122)
Fixed
- Tokens are refreshed ahead of time. If the lifetime of the token is lower than the threshold for refreshing it will cause the client to continously refresh, spamming the server with refresh requests. A lower bound of 10 seconds has been introduced. (#2115, since v1.0.2)
- Prevent automatic token refreshes for Realms that have been closed. Previously, these could have resulted in obscure
Unhandled session token refresh error
messages in the logs that were benign. (#2119) - When trying to debug, users could experience a crash with the message
this._constructor is not a function
. (#491 (comment), since v2.19.0-rc.4) - Check the correct name when automatically adding the permission object schemas to the schema for query-based sync realms so that defining types with the same name works correctly. (#2121, since 2.15.0)
- Fixes a bug where the JS engine might garbage collect an object prematurely leading to a native crash. (#496, since v2.19.0)
Compatibility
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
- File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
Internal
- Upgrades to Object Store commit: 66eea3994f598a388a775b93acb1c13603cc65c3
- Aligns better with Node 10 by not using deprecated calls. (#2107, since v2.19.0)