diff --git a/CHANGELOG.md b/CHANGELOG.md index ac63899d..2bd0b44c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ -# Changelog +## vNext (TBD) + +### Enhancements +* None + +### Fixed +* Fixed connecting to the server and opening synced Realms ([#1665](https://github.com/realm/realm-studio/issues/1665), since v15.0.0) + +### Internals +* None ## 15.2.0 (2024-06-12) diff --git a/src/ui/ConnectToServer/ConnectToServer.tsx b/src/ui/ConnectToServer/ConnectToServer.tsx index 9b8e29dd..35d4d899 100644 --- a/src/ui/ConnectToServer/ConnectToServer.tsx +++ b/src/ui/ConnectToServer/ConnectToServer.tsx @@ -93,7 +93,7 @@ export const ConnectToServer = ({ type="url" name="serverUrl" id="serverUrl" - placeholder="https://realm.mongodb.com" + placeholder="https://services.cloud.mongodb.com" value={url} onChange={onUrlChanged} /> diff --git a/src/ui/ConnectToServer/index.tsx b/src/ui/ConnectToServer/index.tsx index 4fdf6d09..da15ec9b 100644 --- a/src/ui/ConnectToServer/index.tsx +++ b/src/ui/ConnectToServer/index.tsx @@ -35,7 +35,8 @@ import { import { ConnectToServer } from './ConnectToServer'; -const DEFAULT_BASE_URL = 'https://realm.mongodb.com'; +const DEFAULT_BASE_URL = 'https://services.cloud.mongodb.com'; +const LEGACY_BASE_URL = 'https://realm.mongodb.com'; /* const MISSING_PARAMS_MESSAGE = @@ -83,7 +84,7 @@ class ConnectToServerContainer extends React.Component< const url = this.props.url || this.getLatestUrl(); this.setState({ // Use an empty input instead of filling in the default URL - url: url === DEFAULT_BASE_URL ? '' : url, + url: url === DEFAULT_BASE_URL || url === LEGACY_BASE_URL ? '' : url, appId: this.getLatestAppId(), }); // this.restoreCredentials(url); @@ -114,9 +115,8 @@ class ConnectToServerContainer extends React.Component< const { appId, url } = this.state; // Use SDK default (passing undefined) on an empty string. const baseUrl = url || DEFAULT_BASE_URL; - // Clear test state to invalidate the shared App cache as a work around for + // TODO: Clear test state to invalidate the shared App cache as a work around for // https://github.com/realm/realm-js/issues/6276 - (Realm.App as any)._clearAppCache(); const app = new App({ id: appId, baseUrl }); const serializedCredentials = this.serializeCredentials(); const credentials = hydrateCredentials(serializedCredentials); diff --git a/src/ui/reusable/RealmLoadingComponent/index.tsx b/src/ui/reusable/RealmLoadingComponent/index.tsx index 6c8fbe18..137df745 100644 --- a/src/ui/reusable/RealmLoadingComponent/index.tsx +++ b/src/ui/reusable/RealmLoadingComponent/index.tsx @@ -156,11 +156,12 @@ export abstract class RealmLoadingComponent< }); const credentials = hydrateCredentials(realm.credentials); const user = await app.logIn(credentials); - return new Realm({ + return Realm.open({ encryptionKey: realm.encryptionKey, sync: { user, flexible: true, + /* initialSubscriptions: { update(subs, realm) { for (const schema of realm.schema) { @@ -169,6 +170,7 @@ export abstract class RealmLoadingComponent< } }, }, + */ }, schema, schemaVersion,