Upgrading to Realm Sync 3.0.0-rc.2 (#1706)

* Adding role to __User.
* Update to Realm Sync 3.0.0
* Renamed defaultSyncConfiguration to automaticSyncConfiguration
This commit is contained in:
Kenneth Geisshirt 2018-03-13 14:27:31 +01:00 committed by GitHub
parent edfdd933b0
commit 9435490ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -26,7 +26,7 @@
- For non-synced Realms, all privileges are always granted.
- For more details, please read the reference documentation.
* [Sync] Revoke refresh token upon logout (#1354).
* Added `Realm.defaultSyncConfiguration()` which will return the configuration for a default synced Realm (#1688).
* Added `Realm.automaticSyncConfiguration()` which will return the configuration for a default synced Realm (#1688).
* [Sync] Deprecated `Realm.Sync.setFeatureToken` (#1689).
### Bug fixes
@ -34,7 +34,7 @@
### Internal
* Updated to Realm Core 5.4.0.
* Updated to Realm Sync 3.0.0-rc.1.
* Updated to Realm Sync 3.0.0.
* Tested against Realm Object Server 3.0.0-alpha.8.
* Added `_disablePartialSyncUrlChecks` to `Realm.Configuration`.

View File

@ -1,5 +1,5 @@
PACKAGE_NAME=realm-js
VERSION=2.3.0-beta.3
REALM_CORE_VERSION=5.4.0
REALM_SYNC_VERSION=3.0.0-rc.1
REALM_SYNC_VERSION=3.0.0
REALM_OBJECT_SERVER_VERSION=3.0.0-alpha.8

View File

@ -126,7 +126,7 @@ class Realm {
* @returns {Realm~Configuration} - a configuration matching a default synced Realm.
* @since 2.3.0
*/
static defaultSyncConfiguration() {}
static automaticSyncConfiguration() {}
/**
* Closes this Realm so it may be re-opened with a newer schema version.

View File

@ -152,7 +152,7 @@ module.exports = function(realmConstructor) {
setConstructorOnPrototype(realmConstructor.Sync.Session);
// A configuration for a default Realm
realmConstructor.defaultSyncConfiguration = function() {
realmConstructor.automaticSyncConfiguration = function() {
let users = this.Sync.User.all;
let identities = Object.keys(users);
if (identities.length === 1) {
@ -215,7 +215,8 @@ module.exports = function(realmConstructor) {
name: '__User',
primaryKey: 'id',
properties: {
id: 'string'
id: 'string',
role: '__Role'
}
});

2
lib/index.d.ts vendored
View File

@ -569,7 +569,7 @@ declare class Realm {
/**
* Return a configuration for a default Realm.
*/
static defaultSyncConfiguration(): string;
static automaticSyncConfiguration(): string;
/**
* Delete the Realm file for the given configuration.

View File

@ -180,7 +180,7 @@ module.exports = {
.then(() => Realm.Sync.User.login('http://localhost:9080', username, 'password'))
.then(u => {
user = u;
return Realm.open(Realm.defaultSyncConfiguration());
return Realm.open(Realm.automaticSyncConfiguration());
})
.then(realm => {
let actualObjectsCount = realm.objects('Dog').length;