From f70539ac2adc37bfe104e921f854cb11d569f329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Fri, 3 Nov 2017 15:35:28 +0100 Subject: [PATCH 1/3] Showing sync errors --- src/services/ros/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/ros/index.ts b/src/services/ros/index.ts index 2c698c08f..6bbcccc7a 100644 --- a/src/services/ros/index.ts +++ b/src/services/ros/index.ts @@ -2,6 +2,7 @@ import { remote as electron } from 'electron'; import * as path from 'path'; import * as Realm from 'realm'; +import { showError } from '../../ui/reusable/errors'; import { IServerCredentials, ServerCredentialsKind, @@ -107,6 +108,9 @@ export const getRealm = async ( sync: { url, user, + error: (err: any) => { + showError('Error while synchronizing Realm', err); + }, }, }); From 26439beef16a49705cc7837e83de6d025e72f019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Fri, 3 Nov 2017 15:36:04 +0100 Subject: [PATCH 2/3] Choosing realm or realms based on http vs https --- src/services/ros/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ros/index.ts b/src/services/ros/index.ts index 6bbcccc7a..3e7533748 100644 --- a/src/services/ros/index.ts +++ b/src/services/ros/index.ts @@ -55,7 +55,7 @@ export enum AccessLevel { const getRealmUrl = (user: Realm.Sync.User, realmPath: string) => { const url = new URL(realmPath, user.server); - url.protocol = 'realm:'; + url.protocol = url.protocol === 'https:' ? 'realms:' : 'realm:'; return url.toString(); }; From 065b4cb124ed87e7baed18d164b5fcb6e1f2924c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Fri, 3 Nov 2017 15:36:30 +0100 Subject: [PATCH 3/3] Changing passwords fixed --- src/services/ros/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/ros/index.ts b/src/services/ros/index.ts index 3e7533748..e530d8978 100644 --- a/src/services/ros/index.ts +++ b/src/services/ros/index.ts @@ -144,8 +144,9 @@ export const updateUserPassword = async ( password: string, ) => { const server = adminUser.server; + const url = new URL('/auth/password', server); // TODO: This could be moved to Realm-JS instead - const request = new Request(`${server}/auth/password`, { + const request = new Request(url.toString(), { method: 'PUT', headers: new Headers({ Authorization: adminUser.token,