Commit Graph

64 Commits

Author SHA1 Message Date
blagoev aefd81ccf7 Kneth/fix partial sync (#1383)
* fix typo in subscribeToObjects
* Fix partial sync test
* Swap error and result order in callback
* Use correct url
2017-10-04 11:28:50 +02:00
Kenneth Geisshirt feb59ae859 Partial sync (#1361) 2017-10-02 20:29:36 +02:00
Kenneth Geisshirt fe121ea27b Client reset (#1341) 2017-10-02 19:44:24 +02:00
Kenneth Geisshirt 51a4f524a9 Updating to core 4.0.0 and sync 2.0.0-rc25 (#1360)
* Updating to core 4.0.0 and sync 2.0.0-rc25
* Adding file to React Native projects
* Move sync_config.cpp to the correct target in the Xcode project.
2017-09-29 00:31:22 +02:00
Kenneth Geisshirt c370de6d5d Linker issue. 2017-09-27 22:31:27 +02:00
Kenneth Geisshirt a738415763 wip 2017-09-27 21:02:09 +02:00
Kenneth Geisshirt 2caa14abf2 Don't expose an initializer function. 2017-09-27 20:16:44 +02:00
Kenneth Geisshirt f94f351bfb Adding documentation, TS definition and change log. 2017-09-27 17:53:09 +02:00
Kenneth Geisshirt e669a221a1 Cleaning up 2017-09-27 16:00:45 +02:00
Kenneth Geisshirt f4248f5d30 wip 2017-09-27 15:59:21 +02:00
Thomas Goyne 2298609ce5 Merge remote-tracking branch 'origin/master' into tg/merge-master-to-2.0.x
* origin/master: (23 commits)
  Fix api doc error
  fix progress notifications registrations
  Fix typo in Github issue template
  Fix port conflict between RN >= 0.48 and RPC server (#1294)
  Disable testAddListener when running in chrome
  Ensure RN has an event loop running for async tests
  Make permission tests better handle server delays
  Fix race conditions in testAddListener
  Separate build and test steps in xcode to reduce chance of hitting "Early unexpected exit"
  Ignore errors when sourcing nvm.sh
  Don't forward arguments to nvh.sh
  Skip sourcing nvm.sh if it's already available
  Fix some shellcheck warnings
  Ensure node 6.5.0 is installed on CI
  Build realm from source for each test-runner test
  Improve error reporting for incorrect argument counts for Realm methods
  Use the same error messages in the RPC code as the regular code
  Silence an unused variable warning when building with sync disabled
  Check the exception message in all Realm tests which assert an exception is thrown
  Don't discard the actual error message in validated_get_X
  ...
2017-09-25 09:40:56 -07:00
Morten Krogh fbe619c255 Changed ssl_verify_callback to open_ssl_verify_callback.
Changed the preverifyOk to acceptedByOpenSSL and made it a Boolean.
Changed jsdoc formatting.
2017-09-25 11:05:16 +02:00
Morten Krogh c1e198cbab Documentation and comments for ssl_verify_callback. 2017-09-22 11:21:36 +02:00
Morten Krogh 3657ef385c The sync config object gets a new property called ssl_verify_callback.
The callback is used to let JS code decide whether the server's SSL
certificate should be accepted or rejected. The ssl_verify_callback
function is only applicable for platforms using OpenSSL.
2017-09-22 10:29:37 +02:00
blagoev 275db8a631 fix progress notifications registrations 2017-09-20 21:59:07 +03:00
Kenneth Geisshirt eeb78d8e1b Merge branch 'master' of github.com:realm/realm-js into 2.0.x 2017-09-18 09:46:36 +02:00
blagoev 069bdfd2af change the this argument for the callback 2017-09-12 02:47:07 +03:00
blagoev 87c88b746a better naming for private properties 2017-09-11 15:50:44 +03:00
blagoev c843f8e7f9 Validate callback was registered on unregistration 2017-09-11 15:50:44 +03:00
blagoev 37a5a92cc9 address reviews 2017-09-11 15:50:44 +03:00
blagoev 3a8f56cdc0 Remove dead code 2017-09-11 15:50:44 +03:00
blagoev e1cebe073a add progress notifications api 2017-09-11 15:50:44 +03:00
Yavor Georgiev b567cd3006 Make a session bind callback factory (#1289)
which can be used in GlobalNotifier
2017-09-11 12:21:44 +02:00
Thomas Goyne 736277084e Fix creating admin token users 2017-08-31 13:49:45 -07:00
blagoev f115a641b0 Remove not needed casts 2017-08-29 14:52:04 -07:00
blagoev 736cbd3ef3 Update object store 2017-08-29 14:51:25 -07:00
Yavor Georgiev 1ba9b434b4 Add a new optional server parameter to User.adminUser (#1111)
* add a new optional server parameter to User.adminUser

This enables `User.openManagementRealm()` for admin token users.

* changelog

* API docs
2017-07-10 15:04:55 +02:00
Yavor Georgiev 7ab3aff82f Expose admin users to JS (#1100)
The JS binding used to conflate `SyncUser::is_admin()` with the user being created by calling `Realm.Sync.User.adminToken()`, but now that we expose a user’s role on the server under `is_admin()` this supposition is no longer correct.

#1097 attempted to fix one such case, but fixing it only uncovered another: in `UserClass<T>::all_users()`.  I’ve gone through all the callsites of `SyncUser::is_admin()` to make sure they don’t assume an admin token user.
2017-06-27 20:32:34 +02:00
Yavor Georgiev beda604425 Fix refreshing the access token of a logged-in admin user (#1097)
Fixes #1091
2017-06-26 12:03:48 +02:00
Yavor Georgiev acd962d602 Make sure all callbacks enqueue on the Node.js event loop (#1079)
Fixes #1077
2017-06-19 13:19:43 +02:00
Yavor Georgiev 3e80683ad8 Extract admin status from the refresh token (#1078)
* Extract admin status from the refresh token

Fixes #1063

* wire up rpc
2017-06-17 16:59:15 +02:00
Thomas Goyne 08052e12f6 Update to work with new API for arrays of primitives 2017-05-17 11:02:45 -07:00
Radu Tutueanu f6564ca68f Add the variables to the syncConfig 2017-05-05 13:50:45 +02:00
Radu Tutueanu b9f90a956b Update handling of ssl certificates according to changes in OS 2017-05-05 11:48:34 +02:00
Radu Tutueanu ba0b298244 Merge pull request #971 from realm/al/notifier-fix
Use notifier fix in latest object store, update core & sync
2017-04-19 13:20:42 +03:00
Ari Lazier 8e43eb7441 use notifier fix in latest object store, update core 2017-04-18 10:58:50 -07:00
Yavor Georgiev 8b652b4e8a Expose option to force the sync history type when opening a realm (#966) 2017-04-18 13:41:07 +03:00
Yavor Georgiev 80818779ba Fix opening synced realm with an encryption key (#945) 2017-03-28 14:34:27 +02:00
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 7843e72595 Don’t capture the current JS context in the session bind callback (#839) 2017-02-02 15:41:52 +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
Yavor Georgiev 5183ff9a8c Always invoke sync callbacks on the JavaScript thread (#809)
* Always invoke sync callbacks on the JavaScript thread

* Address review comments

* Make Callback::m_state be a shared, not a weak pointer

* Use the protected GlobalContext in the session bind handler

* Only dispatch on the event loop if we’re not on its thread
2017-01-23 12:37:13 +01:00
Mark Rowe c4b22a160a Update to sync v1.0.0-BETA-6.3 (#776)
* Update to sync v1.0.0-BETA-6.3.

This requires updating to current object store master to accommodate the
changes to sync error reporting.

* Add some include folder search paths

* Add thread_safe_reference to the RealmJS target
2017-01-04 15:07:25 +01:00
Ari Lazier 43cb7bc463 only use custom dir for the notifier 2016-12-09 17:16:07 +01:00
Ari Lazier 64730e7e97 allow use of a custom sync dir 2016-12-09 12:49:59 +01:00
Ari Lazier 696a80ec0a merge master 2016-12-05 16:25:07 +01:00
Ari Lazier 6ed6b77b52 Remove unneccesary braces 2016-11-28 10:40:50 -08:00
Ari Lazier e48e0b19f7 fixes for latest object store update 2016-11-28 07:42:41 -08:00