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

Use device IP addresses to connect to RPC host #292

Merged
merged 3 commits into from
Mar 16, 2016
Merged

Conversation

appden
Copy link
Contributor

@appden appden commented Mar 1, 2016

It still only tries localhost for the simulator, but for devices, we now get a list of possible IP addresses to attempt to connect to before throw a more helpful exception.

Resolves #284 and fixes #276

It still only tries localhost for the simulator, but for devices, we now get a list of possible IP addresses to attempt to connect to before throw a more helpful exception.

Resolves #284 and fixes #276
@appden
Copy link
Contributor Author

appden commented Mar 4, 2016

@alazier will you take a look at this

@jwhitley
Copy link

jwhitley commented Mar 7, 2016

FWIW, I'm blocked by #284 trying to evaluate realm-js for our needs. In my case, I've only tried to run in the iOS Simulator so far.

I decided to give this branch a spin to provide feedback, but it's dying in the simulator at index.js:29. Screencap:

screenshot_3_7_16__2_32_pm

This is the first time I've tried to build Realm from source, and this smells like a build process issue rather than a code issue? My local Realm build setup sequence follows:

Following the instructions at Building Realm, I built the RealmReact target in a clone checked out to this branch. I modified my app's package.json to pull in Realm via:

"realm": "file:/path/to/realm-js",

Next, I ran export SKIP_ANDROID_BUILD=1; npm install realm in my app's root dir. Finally, I rebuilt and ran my app with the updated Realm version.

Offhand, it's not apparent what I may have missed, but the bit where NativeModules.Realm is apparently undefined definitely seems like a smoking gun. :-/

Pointers (and perhaps improved setup docs for outside contributors...) would be greatly appreciated.

@appden
Copy link
Contributor Author

appden commented Mar 7, 2016

@jwhitley thanks for the detailed report! Can you confirm that the RealmReact.framework is present in the Embedded Binaries and Link Binary with Libraries sections as describes in the Getting Started documentation. If it isn't, then please follow those steps and let me know if that fixes things. I will improve the error message for this case.

@jwhitley
Copy link

jwhitley commented Mar 8, 2016

@appden, thanks, reviewing those settings fixed it. I got lazy, only lightly skimmed the getting started steps, due to a bad assumption that rnpm had set me up correctly. (Only because it's done the right thing infallibly every other time I've used it...)

So far, so good with this branch on the iOS Simulator. I'll have a go with a development device tomorrow and report back.

@appden
Copy link
Contributor Author

appden commented Mar 9, 2016

@jwhitley I'm curious to hear how it worked for you on a device. We'd like to support rnpm, but will probably need to send them a PR to make it work (you can follow progress here: #226).

}

// Log the original exception for debugging purposes.
console.error(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only logs the error of the last failure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the point since it's almost always going to try multiple IP addresses, so we'd just be spamming the console if we logged every error.

appden added a commit that referenced this pull request Mar 16, 2016
Use device IP addresses to connect to RPC host
@appden appden merged commit 1e652d9 into master Mar 16, 2016
@appden appden deleted the sk-debug-on-device branch March 16, 2016 19:51
@jwhitley
Copy link

@appden Sorry for the late response, but this change as merged on master is working fine on a device for me. FWIW, this is with a modified AppDelegate.m in my project that injects the current build hosts' hostname in debug builds, instead of just hardcoding localhost. Thus the on-device dev instance is also connected to the hosts' dev-mode packager. (A change which I've really got to submit upstream...)

@appden
Copy link
Contributor Author

appden commented Mar 16, 2016

@jwhitley thanks for the update! I'd really appreciate you trying to use version 0.11.0-rc from npm if you get the chance.

@wulaizi
Copy link

wulaizi commented Dec 1, 2020

Eh, now 10.0.0-rc.2 this problem is still not resolved

@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.
Labels
None yet
Projects
None yet
4 participants