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

Syncing realm whist debugging throws XMLHttpRequest failure #3452

Closed
andrew-whitmore opened this issue Dec 8, 2020 · 5 comments · Fixed by #3456
Closed

Syncing realm whist debugging throws XMLHttpRequest failure #3452

andrew-whitmore opened this issue Dec 8, 2020 · 5 comments · Fixed by #3456
Assignees

Comments

@andrew-whitmore
Copy link

andrew-whitmore commented Dec 8, 2020

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

@kraenhansen kraenhansen self-assigned this Dec 9, 2020
@kneth
Copy link
Contributor

kneth commented Dec 9, 2020

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

@kraenhansen
Copy link
Member

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 #3454. I'm actively working on resolving this (and any other related issues I might discover along the way).

@andrew-whitmore
Copy link
Author

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

@andrew-whitmore
Copy link
Author

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

@kraenhansen
Copy link
Member

kraenhansen commented Dec 17, 2020

@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 🙂

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants