From dfc6aea6a6089acbac347f2a151084c53b5c2626 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 8 Mar 2018 17:27:13 +0100 Subject: [PATCH] Deprecated setFeatureToken(). (#1694) --- CHANGELOG.md | 1 + lib/extensions.js | 6 +----- lib/index.d.ts | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da96615f..34b157a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Method `Realm.privilges()` to compute privileges on a Realm, a Realm object schema, or a Realm object. The method returns either a `Realm.Permissions.Realm` or `Realm.Permissions.Class` object. - For non-synced Realms, all privileges are always granted. - For more details, please read the reference documentation. +* [Sync] Decrepated `Realm.Sync.setFeatureToken` (#1689). ### Internal * Updated to Realm Core 5.3.0. diff --git a/lib/extensions.js b/lib/extensions.js index 033d305c..2f3792f4 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -151,11 +151,7 @@ module.exports = function(realmConstructor) { if (realmConstructor.Sync._setFeatureToken) { realmConstructor.Sync.setFeatureToken = function(featureToken) { - if (typeof featureToken !== 'string' && !(featureToken instanceof String)) { - throw new Error("featureToken should be a string"); - } - - realmConstructor.Sync._setFeatureToken(featureToken.trim()); + console.log('Realm.Sync.setFeatureToken() is deprecated and you can remove any calls to it.'); } } diff --git a/lib/index.d.ts b/lib/index.d.ts index 21f0e93a..f7fa3cdd 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -448,6 +448,10 @@ declare namespace Realm.Sync { function removeListener(regex: string, name: string, changeCallback: (changeEvent: ChangeEvent) => void): Promise; function setLogLevel(logLevel: 'all' | 'trace' | 'debug' | 'detail' | 'info' | 'warn' | 'error' | 'fatal' | 'off'): void; function initiateClientReset(path: string): void; + + /** + * @deprecated, to be removed in future versions + */ function setFeatureToken(token: string): void; type Instruction = {