Releases: realm/realm-js
Releases · realm/realm-js
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)
v2.19.1
Enhancements
- None.
Fixed
- The Typescript definition for
Realm.Permissions.Permission
did not have the correctrole
property defined. This could result in compilation errors like thiserror TS2339: Property 'role' does not exist on type 'Permission'
. (#2106, since v2.3.0.) - Removes calls to
new Buffer()
as this is deprecated with Node 10. (#2107, since v2.19.0) - Updates the type definitions to be explicit that the return type of the generics
Realm.objects<T>
,Realm.objectForPrimaryKey<T>
, etc. is an intersection ofT & Realm.Object
. (#1838) - A set of bugs that could lead to bad changesets have been fixed. An example of error message is
Failed to parse, or apply received changeset: ndx out of range
. (Fixed by Realm Sync v3.13.3)
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
- Introduces 100 ms delay before submitting analytics so that an app may disable it after importing Realm. (#2108)
- Distinguish between node.js and electron in the
BindingType
field when submitting analytics. (#2108) - Adds a package to compute the Windows analytics identifier rather than returning
null
which likely accounts for the disproportionally large number of unique Windows users. (#2108) - Upgrades to Realm Core v5.12.1.
- Upgrades to Realm Sync v3.13.4.
2.19.0
This release contains all changes from v2.19.0-rc.1 to v2.19.0-rc.5.
Enhancements
- Adds
SyncConfig.customQueryBasedSyncIdentifier
to allow customizing the identifier appended to the Realm path when opening a query based Realm. This identifier is used to distinguish between query based Realms opened on different devices and by default Realm builds it as a combination of a user's id and a random string, allowing the same user to subscribe to different queries on different devices. In very rare cases, you may want to share query based Realms between devices and specifying thecustomQueryBasedSyncIdentifier
allows you to do that. - Adds
Realm.subscriptions()
to query active query-based sync subscriptions. This method is in beta and might change in future releases. (#2052) - Adds
Realm.unsubscribe()
to unsubscribe by name an active query-based sync subscription. This method is in beta and might change in future releases. (#2052) - Improves the proactive token refresh mechanism to make several attempts to refresh the token before it expires and to also ensure that there is only one ongoing refresh timer for a combination of user and realm path. Previously it was possible to end up in a situation where many redundant refreshes were scheduled for the same Realm. (#2071)
- A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with an url that lacks the path component (e.g.
realm://foo.com
) would result in errors likeCannot read property ‘token_data’ of undefined
. Instead, now we'll print out the Realm url and provide a more meaningful exception message. (#ROS-1310) - Adds support for Node 10. Pre-gyp'ed binaries are available for Node 6, 8, and 10. (#1813 and #2087)
- Building for iOS can now use the
n
node version manager. Thanks to @SandyChapman! (#2078)
Fixed
- Fixes the TypeScript definitions for
User.login
to make it explicit in which cases a promise and in which aUser
is returned. (#2050, since 2.16.0). - Fixes the exception being thrown when using the deprecated
User.registerWithProvider
API and not providing a value foruserInfo
. (#2050, since 2.16.0). - Fixes the signature of
user.logout
to return aPromise<void>
rather thanvoid
. It has always done asynchronous work, but previously, it was impossible to be notified that the call has completed. Since that is now possible, the superfluousUser is logged out
message printed in the console upon logout has been removed. (#2071, since v2.3.0) - Fixes opening query-based Realms with a dynamic schema. Previously the schema would always contain only the types present when the Realm was first added and not any types added later. (#2077, since v2.3.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 Realm Core v5.12.0.
- Upgrades to Realm Sync v3.13.1.
- Updates to
package.json
andREADME.md
. Thanks to @hyandell.
2.19.0-rc.5
Enhancements
- A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with a url that lacks the path component (e.g.
realm://foo.com
) would result in errors likeCannot read property ‘token_data’ of undefined
. Instead, now we'll print out the Realm url and provide a more meaningful exception message. (#ROS-1310, since v1.0.2) - Adds support for Node 10. Pre-gyp'ed binaries are available for Node 6, 8, and 10. (#1813 and #2087)
Fixed
- None.
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
- Building for iOS can now use the
n
node version manager. Thanks to @SandyChapman! (#2078) - Upgrading to Realm Core v5.12.0.
- Upgrading to Realm Sync v3.13.1.
2.19.0-rc.3
Enhancements
- Improved the proactive token refresh mechanism to make several attempts to refresh the token before it expires and to also ensure that there is only one ongoing refresh timer for a combination of user and realm path. Previously it was possible to end up in a situation where many redundant refreshes were scheduled for the same Realm. (#2071, since v1.0.2)
Fixes
- Fixed the signature of
user.logout
to return aPromise<void>
rather thanvoid
. It has always done asynchronous work, but previously, it was impossible to be notified that the call has completed. Since that is now possible, the superfluous "User is logged out" message printed in the console upon logout has been removed. (#2071, since v2.3.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
- None.
2.19.0-rc.2
Enhancements
- Added
Realm.subscriptions()
to query active query-based sync subscriptions. This method is in beta and might change in future releases. (#2052) - Added
Realm.unsubscribe()
to unsubscribe by name an active query-based sync subscription. This method is in beta and might change in future releases. (#2052)
Fixed
- None.
Compatibility
- File format: ver. 9 (upgrades automatically from previous formats)
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
v2.19.0-rc.1
Enhancements
- Added
SyncConfig.customQueryBasedSyncIdentifier
to allow customizing the identifier appended to the realm path when opening a query based Realm. This identifier is used to distinguish between query based Realms opened on different devices and by default Realm builds it as a combination of a user's id and a random string, allowing the same user to subscribe to different queries on different devices. In very rare cases, you may want to share query based Realms between devices and specifying thecustomQueryBasedSyncIdentifier
allows you to do that.
Fixed
- Fixed the typescript definitions for
User.login
to make it explicit in which cases a promise is returned and in which - aUser
. (#2050, since 2.16.0). - Fixed an exception being thrown when using the deprecated
User.registerWithProvider
API and not providing a value foruserInfo
. (#2050, since 2.16.0).
Compatibility
- File format: ver. 9 (upgrades automatically from previous formats)
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.
v2.18.0
Enhancements
- Added support for finding Realm-level permissions in Query-based Realms using
realm.getPermissions()
. (#2036) - Added support for finding Class-level permissions in Query-based Realms using
realm.getPermissions(className)
. (#2036) - Added
Realm.Permissions.Realm.findOrCreate(roleName)
andRealm.Permissions.Class.findOrCreate(roleName)
which makes it easier to find or create permissions for a given role when using query-based Realms. (#2036)
Fixes
- Allow
Realm.deleteFile
to be used with a sync configuration. Previously, only local Realms could be deleted with this API and thesync
property on the configuration would be ignored. (#2045, since v1.0.0)
Compatibility
- File format: ver. 7 (upgrades automatically from previous formats)
- Realm Object Server: 3.11.0 or later.
- APIs are backwards compatible with all previous release of realm in the 2.x.y series.