Commit Graph

54 Commits

Author SHA1 Message Date
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
Ari Lazier 2b90def150 terrible hack to make rn not retain the context 2016-11-11 15:05:08 -08:00
Ari Lazier b2077910a4 fix for handle scope warning 2016-11-11 11:41:27 -08:00
Ari Lazier d229cd6130 throw exception when trying to open a realm with an invalid user 2016-11-11 00:14:52 -08:00
Ari Lazier 6d485866f6 all users should return a dictionary 2016-11-10 13:55:22 -08:00
Søren Vind 87b30fb4ec Add tests of Realm.Sync.User.all and Realm.Sync.User.current. Fix both to only return active (logged-in) users. Fix current return values: Throws if >1 user logged in, returns undefined if no logged in. 2016-11-10 12:54:15 -08:00
Ari Lazier 5a49dbc325 make sync work with RealmJS tests 2016-10-27 13:49:41 -07:00
Ari Lazier e52351fc50 add support for logging out 2016-10-26 17:00:46 -07:00
Ari Lazier dfc10a5a42 update to latest object store changes/bugfixes 2016-10-26 17:00:46 -07:00
Ari Lazier d987c7db7b add api for all users 2016-10-26 17:00:46 -07:00
Ari Lazier 92adb669d5 hook up new object store apis 2016-10-26 17:00:46 -07:00