Commit Graph

31 Commits

Author SHA1 Message Date
Yavor Georgiev 7c1dab7079 Propagate token refresh errors to the session error handler (#843)
* 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
2017-02-07 11:01:26 +01:00
Yavor Georgiev bb0dc575c9 Implement proactive access token refresh (#842)
Closes #840
2017-02-03 16:40:13 +01:00
Yavor Georgiev 9d1d970b1f Sync Session API (#825)
* Add Session class and expose it to JS

* Add error property on the sync config object for the event handler

* tests

* refactor access token refresh

* chrome debugging
2017-02-01 14:18:59 +01:00
Kristian Dupont 0c9c5ac407 Add missing chrome debugging apis for Sync.User (#801)
* 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
2017-01-31 14:07:29 +01:00
Ari Lazier 81a32909c1 update to latest object store changes 2016-06-14 14:33:27 -07:00
Scott Kyle 5a3997d268 Fix for consecutive calls to clearTestState()
This bug would only happen from Chrome debug mode, where consecutive calls would crash the app because the m_objects iterator would be in a bad state. This method is faster anyways.
2016-05-26 17:58:24 -07:00
Scott Kyle 18a4d66903 Explicitly stop the RPCWorker in RPCServer destructor 2016-05-03 12:06:15 -07:00
Scott Kyle 32219cf0a3 Clear protected value maps in RPCServer destructor 2016-05-03 11:42:37 -07:00
Scott Kyle e8cd20d7bb Use RPC callback mechanism for writes and listeners
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.
2016-05-02 12:41:53 -07:00
Scott Kyle dd23c66e69 Address some PR feedback with more comments 2016-05-01 14:35:18 -07:00
Scott Kyle 32a8a2ed72 Make migration tests work in Chrome debug mode
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!
2016-04-29 13:55:49 -07:00
Scott Kyle 85919dc66f Fix realm.schema property in Chrome debug mode 2016-04-29 11:16:10 -07:00
Scott Kyle 10f08747e7 Rename remained camelCase to snake_case
And fix some minor build warnings along the way.
2016-04-18 01:01:04 -07:00
Ari Lazier bd4088ce91 key templates off explicitly defined classes rather than the internal type 2016-04-15 13:47:01 -07:00
Scott Kyle c0c65ad620 Make all JSC tests pass again 2016-04-13 03:21:18 -07:00
Scott Kyle 05c432deb1 WIP Node support
The JS engine details are mostly abstracted away. This breaks JSC support until the rest of the pieces are in place. The Node version builds and runs, but crashes when creating a Realm object.
2016-04-12 11:53:30 -07:00
Ari Lazier 9626842f8e start refactoring realm 2016-03-28 13:21:36 -07:00
Karson Miller 5e9333b699 no message 2016-02-18 15:30:44 -08:00
Scott Kyle 2f1eca4a9c Merge branch 'master' into al-android-example
* master:
  Fix typo in README
  Improve clarity of schema parsing and serialization
  Add test that checks schema validation
  Update README with new Schema API
  Cleanup some code and comments to make it consistent
  Convert tests to create objects with property objects
  Update example apps with new schema API
  Remove confusion between propTypes and objectTypes
  Simplify object schema info returned from RPC
  RPC now keeps object keys in the same order
  Change schema API to take properties as an object
  Add method to clear mutation listeners in RPC client
  Plug small leak from not releasing a JSStringRef
  Make RJSStringForValue use consistent exception style
  Improve error messages inside RJSUtil
2016-01-14 15:39:45 -08:00
Scott Kyle 1922125ab0 Improve clarity of schema parsing and serialization 2016-01-13 14:53:39 -08:00
Scott Kyle 15052985f1 Remove confusion between propTypes and objectTypes
The RPC layer now only speaks in objectTypes, since they don't always equate to propTypes. We were overloading the use of propTypes for no good purpose.
2016-01-05 13:53:54 -08:00
Scott Kyle 36ffc6c77c Simplify object schema info returned from RPC
Only the property names are needed.
2016-01-05 13:40:57 -08:00
Scott Kyle c928ab716e RPC now keeps object keys in the same order
Maintaining insertion order when passing objects through the RPC is essential to make the new schema API work.
2016-01-05 13:40:57 -08:00
Nabil Hachicha c3d5fd4e09 add Core include + fix c++14 issue 2016-01-05 11:04:06 -08:00
Ari Lazier 2974d87560 fix imports 2016-01-05 11:04:06 -08:00
Ari Lazier 518133e769 bdash pr fixes 2016-01-04 18:13:09 -08:00
Ari Lazier d964c77d2d store ObjectSchema as a pointer rather than a reference 2016-01-04 16:21:28 -08:00
Ari Lazier df901c636f store ObjectSchema as a pointer rather than a reference 2016-01-04 16:04:01 -08:00
Ari Lazier 5d1e9d4dd3 pr fixes 2015-11-30 11:47:32 -08:00
Ari Lazier 5f584f747f use underscore rather than dash 2015-11-30 11:23:29 -08:00
Ari Lazier eb44b27633 move everything/rename to make room for android 2015-11-30 11:23:29 -08:00