-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSTUDIO-540: Fix connect to server #1666
Conversation
const DEFAULT_BASE_URL = 'https://services.cloud.mongodb.com'; | ||
const LEGACY_BASE_URL = 'https://realm.mongodb.com'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and updated the base URL in the PR as well.
@@ -169,6 +170,7 @@ export abstract class RealmLoadingComponent< | |||
} | |||
}, | |||
}, | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling the initial subscription, since this could potentially result in a huge download that we don't want to wait for.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my testing, I'm unable to reproduce this and it seems fair to disable the workaround for now. I'm leaving the comment for a future where this resurfaces.
@@ -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({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Realm.open
here to ensure the schema gets downloaded before the Realm is considered loaded.
This fixes #1665 by removing the call to an internal method which is no longer present in
realm@12
.