Skip to content
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

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

kraenhansen
Copy link
Member

This fixes #1665 by removing the call to an internal method which is no longer present in realm@12.

@kraenhansen kraenhansen self-assigned this Jun 20, 2024
@cla-bot cla-bot bot added the cla: yes label Jun 20, 2024
@kraenhansen kraenhansen requested a review from gagik June 20, 2024 07:16
Comment on lines +38 to +39
const DEFAULT_BASE_URL = 'https://services.cloud.mongodb.com';
const LEGACY_BASE_URL = 'https://realm.mongodb.com';
Copy link
Member Author

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<
}
},
},
*/
Copy link
Member Author

@kraenhansen kraenhansen Jun 20, 2024

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
Copy link
Member Author

@kraenhansen kraenhansen Jun 20, 2024

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({
Copy link
Member Author

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.

@kraenhansen kraenhansen merged commit 192bfa5 into channel/major-15 Jun 20, 2024
5 checks passed
@kraenhansen kraenhansen deleted the kh/fix-connect-to-server branch June 20, 2024 08:38
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't open device sync in realm studio?
2 participants