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.
* Do not throw when the Sync constructor isn’t there
with unified packaging it’s there all the time now
Closes#1084Fixes#996
* Fix running the sync tests when Sync is disabled
* adding ts and package.json typings
* remove DefinitelyTyped needed comments, we are hosting this ourselves
* adding licensing comments
* Added initial contribution support
Thanks @akim95
* changing year
* adding parameters
* Expand on collection typings
* update the windows pre-gyp script (#1072)
* Extract admin status from the refresh token (#1078)
* Extract admin status from the refresh token
Fixes#1063
* wire up rpc
* Make sure all callbacks enqueue on the Node.js event loop (#1079)
Fixes#1077
* Use an uncached realm instance for _waitForDownload (#1083)
Fixes#1061
* Add objectSchema method to Realm Object (#1055)
* Add objectSchema property to Realm Object
* fix
* fixes
* move typings under lib/
* changelog
* 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 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
* Add Permissions models and User Management Realm API
* docs and changelog
* fix bad merge
* add test
* fix jsdoc annotation
* rename permissions to management schema
* 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
* Use ES6 Proxies to implement collections in the Chrome debugger
* rework realm-test-names event
* move React stuff on the CPH mac mini
* use node with npm3
* remove debugging aid code
* Update test app to RN 0.39.0
* Fix getContext in index.js
* Add dependency on invariant
* Add some comments to getContext
* Make invariant a devdependency rather than a dependency
* Add user file
* Clean up initialization and add error message
* Revert "Add user file"
This reverts commit 2948f4cfc2dfd2d5d75594307b1e89806b817eb7.
* Make index.js more robust
* Fix review comments
Electron is a combination of a node and
Chromium processes. Chromium processes
can have node bindings enabled and can
therefore run most npm modules seamlessly.
The current `lib/index.js` bootstrapping
logic results in a ReferenceError on the
following statement:
typeof Realm != 'undefined'
Thus, checking whether running under node
first allows realm-js to run inside the
Electron renderer (Chromium) process.