From 85a92ca85cd117275f36cb0b6f07ac0fdb3416ad Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 22 Nov 2018 09:27:46 +0100 Subject: [PATCH] Realm._constructor() has been replaced by Realm._asyncOpen() (#2111) * Realm._constructor() has been replaced by Realm._asyncOpen() --- CHANGELOG.md | 4 +++- lib/browser/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7348bae0..5faffbbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,12 @@ x.x.x Release notes (yyyy-MM-dd) ============================================================= ### 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](https://github.com/realm/realm-js/issues/2102)) -* Adds support for uploading and downloading changes using `Realm.Sync.Session.uploadAllLocalChanges(timeout)` and `Realm.Sync.Session.downloadAllRemoteChanges(timeout)`. ([#2122](https://github.com/realm/realm-js/issues/2122)) +* Adds support for uploading and downloading changes using `Realm.Sync.Session.uploadAllLocalChanges(timeout)` and `Realm.Sync.Session.downloadAllRemoteChanges(timeout)`. ([#2122](https://github.com/realm/realm-js/issues/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](https://github.com/realm/realm-js/issues/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](https://github.com/realm/realm-js/pull/2119)) +* When trying to debug, users could experience a crash with the message `this._constructor is not a function`. (https://github.com/realm/realm-js/issues/491#issuecomment-438688937, 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](https://github.com/realm/realm-js/pull/2121), since 2.15.0) ### Compatibility @@ -16,6 +17,7 @@ x.x.x Release notes (yyyy-MM-dd) ### Internal * Upgrades to Object Store commit: 66eea3994f598a388a775b93acb1c13603cc65c3 +* Aligns better with Node 10 by not using deprecated calls. ([#2107](https://github.com/realm/realm-js/issues/2107), since v2.19.0) 2.19.1 Release notes (2018-11-15) ============================================================= diff --git a/lib/browser/index.js b/lib/browser/index.js index 7f3c64e1..254795ef 100644 --- a/lib/browser/index.js +++ b/lib/browser/index.js @@ -77,7 +77,6 @@ function getObjectType(realm, type) { export default class Realm { constructor(config) { - config = this._constructor(config); let schemas = typeof config == 'object' && config.schema; let constructors = schemas ? {} : null; @@ -133,6 +132,7 @@ util.createMethods(Realm.prototype, objectTypes.REALM, [ 'close', '_waitForDownload', '_objectForObjectId', + '_asyncOpen' ]); // Mutating methods: