Realm-js : Open Synced Realm in Cloud never Completes

ros

#1

Code/Log Snippet

In the below image, I showcase the code that implemented to:

  1. Login the realm-admin
  2. Use the resolved User to open the realm
  3. Lastly fetch Dogs, set up listener, and set the state status to ‘Loaded’

In addition the log on the right tells us the following:

  1. ‘opening realm’ is logged
  2. But neither the reject nor the resolve takes place
  3. As indicated by no additional logging by my catch
  4. As well as by the fact that that ‘realm opened’ is not logged

My only clue is the ‘Setting a timer for a long period of time’. No idea what that indicates about any issues with opening a Synced Realm that is in Cloud.


#2

As an aside below is an image:

  1. Showcasing the Cloud instance as seen by Realm Studio.
  2. Our realm-admin user and his 1 realm
  3. And our React Native app where the Status is still ‘Loading’

#3

@509dave16 This is unexpected behavior - can you file an issue here:

with your code snippet please and cc @ianpward

Would also be great to see the debug logs on the server side


#4

Was there ever any resolution on this? I’m experiencing exactly the same issue. Any help would be appreciated!


#5

@tomsjansons There is an issue with RN accessing the Android certificate Truststore so a quick fix is to just disable SSL validation in the config like this:

let config = {
                sync: {
                    user: user,
                    url: 'realms://' +loginData.server +'/default',
                    partial: true, 
                    validate_ssl:false,
                    error: (session, error) => console.log(error)
                },
                schema: [ChatItem, ChatRoom]
            };
          Realm.open(config)

#6

Hey @ianward any further information on this? I’m on RN Android and having this issue. validate_ssl: false doesn’t solve the issue.
With the realm that I open I can write to it and the data appears in the ROS. But any data on the server never appears (syncs) on the client.

Realm.Sync.User.login(url, username, password)
    .then(user => {
      const config = user.createConfiguration({
        sync: {
          fullSynchronization: false,
          url: `realms://${rosURL}/~/myRealm`,
          errror: err => console.log(err),
          validate_ssl: false
        },
        schema: [Todo, TodoList]        
      });
     
      Realm.open(config).then(realm => {
          // Can write here
          // can't read
          console.log(realm.objects("Todo")) // just gives {} despite there being data in the ROS realm.

      })

I’ve also used the .progress() to check that data(?) is being sent and it does: I see ~ 4970 transferred

Otherwise the details are very similar to 509dave16 above, seing the “Setting a timer for a long period of time” warning etc.


Let me know if I can provide any details or a repro


#7

@jackhurley23 I believe this issue was fixed in the latest version but from looking at your code are you sure you are chaining the API calls together correctly? Try printing out config and making sure you have a valid user. Additionally, you can probably see from the logs what is going on - check the server-side and client-side trace level logs.