Realm-js: Syncing realm whist debugging throws XMLHttpRequest failure

Created on 8 Dec 2020  路  5Comments  路  Source: realm/realm-js

Goals

To be able to debug a react native application using realm sync application using chrome debugger using android simulator

Expected Results

The remote data under the specified partition should be pulled to the client application

Actual Results

When opening a realm with the following config

{"sync":{"user":{},"partitionValue":"opUnit=7523&tourDate=2020-12-07&tourName=MA44","existingRealmFileBehavior":{"type":"openImmediately"}}}

with the debugger attached. The app seams to function for a while until the listener that is bound like below is invoked

Realm.open(config).then(projectRealm => {
      realmRef.current = projectRealm;
      const syncParcels = projectRealm.objects('Parcel');
      syncParcels.addListener(() => {
        setData({ parcels: [...syncParcels], syncComplete: true });
      });
    });

then in the chrome console the following error is thrown

DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8083/get_property'.
    at makeRequest (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:113621:18)
    at sendRequest (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:113675:22)
    at Object.getProperty (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:113460:18)
    at Object.getProperty (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:113182:33)
    at Object.get (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:113022:21)
    at Object.value (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:115458:29)
    at Function.from (<anonymous>)
    at _iterableToArray (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2858:88)
    at _toConsumableArray (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2842:38)
    at Proxy.eval (http://10.0.2.2:8081/src/providers/tour-parcels-provider.bundle?platform=android&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true:61:54)

The data that is trying to be sent to the rpc service when the error is thrown is:

{"realmId":130823838580256,"id":89,"name":"0","sessionId":1}

There is one record in atlas under the partitonValue opUnit=7523&tourDate=2020-12-07&tourName=MA44 that trying to be synced to the react-native app.

Steps to Reproduce

You should be able to replicate this issue on your sample app https://github.com/mongodb-university/realm-tutorial-react-native as our app follows a similar pattern.

Version of Realm and Tooling

  • Realm JS SDK Version: 10.1.0
  • Node or React Native: react-native version 0.63.3
  • Client OS & Version: Android 29 Simulator
  • Which debugger for React Native: Both react native debugger and chrome debugger yield the same result.

Thanks

Andy

O-Community

Most helpful comment

Thanks again for reporting this! I believe I've identified the root cause, I've fixed it and found a couple of other (related) bugs, which I've documented here https://github.com/realm/realm-js/issues/3454. I'm actively working on resolving this (and any other related issues I might discover along the way).

All 5 comments

@andrew-whitmore Thank you for reporting. We are currently looking into it.

Thanks again for reporting this! I believe I've identified the root cause, I've fixed it and found a couple of other (related) bugs, which I've documented here https://github.com/realm/realm-js/issues/3454. I'm actively working on resolving this (and any other related issues I might discover along the way).

@kraenhansen - Thanks for the speedy reply. Best of luck with the fixes.

@kraenhansen - I can confirm that this now works on 10.1.2. Thanks again for the speedy turn around.

@andrew-whitmore I can't tell you how happy I am that you're finally unblocked! Thanks again for your patience. I wish you and yours a great holiday season 馃檪

Was this page helpful?
0 / 5 - 0 ratings