* Get a session’s error handler
* Change the signature of all methods to add the callee
* Deserialize rpc callbacks
* Expose the session error handle on its config property
* When a token refresh error occurs and there is a session error handler
propagate the error to the handler
* Add user tests
* Add Sync member to Realm
* Add a simple test for addListener
* Introduce browser User class
* Introduce Sync.User proxy
* Fix User.all
* Add User.logout
* Remove some console.log statements
* Update rpc.cpp from tests-folder
* Use user.current from user-methods, not cpp
* remove user.current from two missing places
* Start server in realmjs and react tests
* Add user tests
* Add Sync member to Realm
* Add a simple test for addListener
* Introduce browser User class
* Introduce Sync.User proxy
* Fix User.all
* Add User.logout
* Remove some console.log statements
* Update rpc.cpp from tests-folder
* Use user.current from user-methods, not cpp
* remove user.current from two missing places
* Start server in realmjs and react tests
* Replace needle with node-fetch
* Make AuthError work in the browser
* Allow for persistent callbacks
* Expose _authenticateRealm to native
* Use clear_test_state in roc
* Streamline test inclusion
* Fix login tests
* Promisify testLogin()
* Disable AsyncTests for now
* Mode jasmine timeout to spec/unit_tests.js
* Avoid use of global for fetch module
* Only include user-tests is sync is enabled
* Skip ROS for android tests
* Add some comments about persistent callbacks
* Fix results-test
* Run async-tests in node
* Add a comment about (user object)
* Cache all users in User.current and return promises in fetch
* node_require async-tests so RN doesn't try and package them
* Add missing parenthesis
Since Code runs in Node, rather than Chrome, we need to require the `sync-request` module. The global `__debug__` object was exposed by the vscode-react-native plugin v0.1.5 for us to be able to do that.
Resolves#374
The callbacks are stored by their id in the RPCServer so they are properly uniqued. This prevents the same callback from being added multiple times as a change listener.
All realm operations for the RPC are now done in their own thread so it can be allowed to block on waiting for callback results. The recursive and multi-threaded nature of this makes it pretty tricky, but it works!
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