Commit Graph

354 Commits

Author SHA1 Message Date
Thomas Goyne 72d10eb572 Don't hang forever when the React tests fail to start (#1764)
* Exclude unavailable simulator runtimes
* Fix some warnings
* Don't hang forever when the React tests fail to start
`simctl launch --console` goes into an infinite loop if the app fails to launch
successfully, so don't use --console and manually wait for it to exit.
2018-04-25 08:11:54 +02:00
Artur Miranda 5c86e9e92d Add Subscription import to browser/index.js and register type converter (#1744) 2018-04-18 10:42:02 +02:00
Brian Nicholson 424ff81965 Stringify fetch body in logout (#1731)
* Stringify fetch body in logout
* Update changelog
2018-04-17 15:01:02 +02:00
Thomas Goyne c349d5f185 Retry on network errors when refreshing admin tokens (#1747)
* Retry on network errors when refreshing admin tokens

This is the same logic used for non-admin token user fetches, which seems to
already work fine in practice.
2018-04-12 18:20:25 +02:00
Valerii Hiora c3a83f1866 Added `writeCopyTo` functionality (#1715)
* Added `writeCopyTo` functionality
* Fixes #1678
* Added optional `encryptionKey` to `writeCopyTo`
2018-04-03 11:50:03 +02:00
Kenneth Geisshirt 6b3b34ae54
Merge pull request #1723 from Gerharddc/patch-1
Stop Permissions being redefined and breaking Jest
2018-04-03 11:42:26 +02:00
Thomas Goyne f663e4846c Avoid leaking realms when an error occurs within an event handler 2018-03-22 16:43:39 -07:00
Gerhard de Clercq 7152afddd9
Stop Permissions being redefined and breaking Jest
Fixes a related problem in exactly the same way as https://github.com/realm/realm-js/pull/1695 .
2018-03-21 19:44:57 +02:00
Kenneth Geisshirt c370ef4d86
Testing against ROS 3.0.0. (#1712)
* Testing against ROS 3.0.0.
* Adding Realm.Sync.Subscription.removeAllListeners. Refactor partial sync tests.
* Refactoring partial sync tests.
2018-03-21 18:18:37 +01:00
Thomas Goyne 635d49e09a Throttle HTTP requests made to the auth server
Making thousands of HTTP requests simultaneously inevitably results in some
failing or the server being overwhelmed, so limit how many can be made at once
(currently to the arbitrary cap of 5) and enqueue any further requests.
2018-03-15 17:02:51 -07:00
Kenneth Geisshirt 10480c1afe
Adding optional user as argument to Realm.automaticSyncConfiguration. (#1709) 2018-03-14 08:26:41 +01:00
Kenneth Geisshirt 9435490ea3
Upgrading to Realm Sync 3.0.0-rc.2 (#1706)
* Adding role to __User.
* Update to Realm Sync 3.0.0
* Renamed defaultSyncConfiguration to automaticSyncConfiguration
2018-03-13 14:27:31 +01:00
Kenneth Geisshirt edfdd933b0
Updating API docs and TS definitions (closes #1770). (#1707) 2018-03-13 12:45:23 +01:00
Kenneth Geisshirt 2f20006e47
Kneth/allow partial in urls (#1704)
* Adding _disablePartialSyncUrlChecks.
2018-03-13 08:27:47 +01:00
Kenneth Geisshirt 5cc7bb6aa6
Merge branch 'master' into 2.3.x 2018-03-10 22:36:31 +01:00
Kenneth Geisshirt 9d8a677ecf
Revoke refresh token upon logout. (#1696)
* Revoke refresh token upon logout.
* Always log out
2018-03-09 15:51:45 +01:00
Kenneth Geisshirt abb04e399b
Default sync realm (#1693)
* Configuration for default Realm.
* Use url-parse to make RN happy.
2018-03-09 10:40:45 +01:00
Alex Bass 032757a6e5 Stop worker being redefined and breaking Jest #1635 (#1695) 2018-03-08 13:26:00 -08:00
Kenneth Geisshirt dfc6aea6a6
Deprecated setFeatureToken(). (#1694) 2018-03-08 17:27:13 +01:00
Kenneth Geisshirt 1066722a09 Revert "Deprecated setFeatureToken()."
This reverts commit d846794cd5.
2018-03-08 15:47:50 +01:00
Kenneth Geisshirt d846794cd5 Deprecated setFeatureToken(). 2018-03-08 15:44:11 +01:00
Thomas Goyne d1a4e899d8 Fix the Permissions typescript definitions 2018-03-02 15:36:45 -08:00
Thomas Goyne fadd35bb26 Add a typescript declaration for Sync.SubscriptionState 2018-03-02 15:36:10 -08:00
Thomas Goyne ac7f7d9c4e Add schema definitions for the permissions types 2018-03-01 16:16:43 -08:00
Kenneth Geisshirt 615d6ff35e Merge branch '2.3.x' of github.com:realm/realm-js into 2.3.x 2018-02-27 10:58:58 +01:00
Kenneth Geisshirt 462856a24d
Partial sync (#1583)
The new Partial Sync API
2018-02-20 13:40:54 +01:00
Kræn Hansen fdf9497bdd Fixing objectForPrimaryKey return type (#1664)
According to https://github.com/realm/realm-js/blob/master/docs/realm.js#L171 and runtime behaviour it returns `undefined` not `null` if the object doesn't exist.
2018-02-16 10:27:30 +01:00
Thomas Goyne e6591a7c9c Wait for pending notifications to complete when removing a sync listener (#1648)
With async callbacks, in-process listeners need to be able to wait for anything
currently in progress to complete just like out-of-process listeners. In
addition, removeListener() needs to be declared as returning a Promise so that
typescript code can actually use it.
2018-02-01 14:38:02 +01:00
Kenneth Geisshirt 30b87645df
Paramters must be transferred. (#1638) 2018-01-26 17:21:09 +01:00
Kenneth Geisshirt f9e8161017
Clarifying PermissionCondition. (#1637) 2018-01-25 15:44:47 +01:00
Kenneth Geisshirt ac82bd285d
Fixing a typo in _getExistingUser (#1634) 2018-01-24 08:07:19 +01:00
Kenneth Geisshirt 0c67e2a834
Adding catch to refreshAdminToken. (#1631) 2018-01-18 13:26:14 +01:00
Kenneth Geisshirt a996a1a8b8
Adding _getExitingUser to Chrome debugger support library. (#1628)
* Adding _getExitingUser to Chrome debugger support library.
2018-01-18 12:21:35 +01:00
Thomas Goyne 0c6e254494 Support async sync change listeners (#1626) 2018-01-18 12:20:17 +01:00
Kenneth Geisshirt 193314834e
Copying definition of functions (#1621)
* Copying definition of functions
* Avoid loading when using React Native
2018-01-16 10:11:30 +01:00
Thomas Goyne b9cce49972 Support opening Realms with an admin token without a working ROS directory service (#1615)
* Support opening Realms with an admin token without a working ROS directory service
2018-01-13 10:02:08 +01:00
Kenneth Geisshirt fccc782612
subscribeToObjects is implemented in JS. (#1611) 2018-01-12 10:28:05 +01:00
Mark Rowe cd8db46aa7 When refreshing the token, look up the user in a way that doesn't suffer from #1586 (#1587)
* When refreshing the token, look up the user in a way that doesn't suffer
from #1586

Expose a means of looking up a user by identity and server to avoid
problems if the same user identity exists for multiple servers, which
can happen when connecting to the same server via different hostnames.

* Return undefined if the user doesn't exist rather than returning an object wrapping a null SyncUser.
2018-01-11 16:00:31 +01:00
Thomas Goyne ce67446976 Perform a pseudo-refresh for admin token users (#1599)
* Perform a pseudo-refresh for admin token users

Although we don't need to actually refresh the token, when multiplexing is
enabled we do still need to hit ROS to let it know we're accessing a Realm and
get the sync label.

* Adding brief JSdoc and TS definition for isAdminToken.

* Perform a pseudo-refresh for admin token users

Although we don't need to actually refresh the token, when multiplexing is
enabled we do still need to hit ROS to let it know we're accessing a Realm and
get the sync label.

* Adding brief JSdoc and TS definition for isAdminToken.

* Make the timeout consistent

* Add basic docs for multiprocess notifications (#1594)

* Add basic docs for multiprocess notifications

* Adopt core's query parser and update to core v5.1.2 (#1563)

* Adopt core's query parser.
* Realm Core 5.1.2
* Realm Sync 2.2.9

* Remove tar.xz (#1585)

* remove tar.xz decompression and lzma deps

* Fixing merge

* Updating object store
2018-01-11 14:47:54 +01:00
Nikola Irinchev d6a8cbb1f3
Explicitly send register: false during login (#1596)
* Explicitly send register: false during login

* Update CHANGELOG.md
2018-01-08 11:32:05 +02:00
Kenneth Geisshirt 16a218ad49
Adding JWT auth (#1564)
* Adding method Realm.Sync.User.authenticate()
* Adding JWT provider support to Realm.Sync.User.authenticate()
* Adding password provider support to Realm.Sync.User.authenticate()
2018-01-05 09:38:53 +01:00
Constantin S. Pan 1b0f6c0b21
Increase the token refresh timeout to 10 sec (#1584) 2017-12-21 14:14:07 +01:00
Mark Rowe c2de29ab0c Fix an issue where `Realm.open` would complain about the Realm already
being open with a different schema version

In order to correctly open read-only synchronized Realms, `Realm.open`
would open the Realm without specifying a schema or schema version, wait
for any remote changes to be downloaded (if appropriate), and then
re-open the Realm with the specified schema and schema version. This
would lead to an exception about the Realm being open with a different
schema version if the Realm had previously been opened with a different
schema version, due to the way `RealmCoordinator` caches information
about the schema of open Realms.

We address this by making two changes:
1. `Realm.open` for non-synchronized Realms no longer goes through
`_waitForDownload`. This means the dance described above where the Realm
is opened twice is not used for local Realms.
2. `_waitForDownload` no longer keeps the `Realm` alive until after its
callback has returned. It instead keeps the `SyncSession` alive. This is
sufficient to avoid the connection being torn down and having to
reconnect when `_waitForDownload`'s callback later opens the Realm with
the correct schema and schema version, while also allowing for
`RealmCoordinator`'s cached information to be cleared when the
schemaless Realm is closed prior to the Realm being reopened.

In addition, tests have been added that reproduced the problem in both a
local and sync context.
2017-12-18 14:54:08 -08:00
Yavor Georgiev 4e6cb299b3
Add disableFormatUpgrade to Realm configuration (#1566) 2017-12-14 07:53:03 +01:00
Kenneth Geisshirt aed1ea104b
Adding property Realm.isClosed. (#1560)
* Adding property Realm.isClosed.
2017-12-13 10:09:26 +01:00
Kræn Hansen 70004b9304 Checking the content-type of authentication responses (#1556)
* Checking the content-type of authentication responses
* Adding a changelog entry
* Fixing changelog typos and line endings
2017-12-07 10:36:24 +01:00
Thomas Goyne 8faf94918b Use the sync label as the multiplex identifier 2017-11-16 16:36:58 -08:00
blagoev c68c3983cf format the code 2017-11-14 11:08:40 +02:00
blagoev 9bcfa35bba fix js code 2017-11-14 08:58:21 +02:00
blagoev ba2309a540 revert the promise resolve 2017-11-13 23:31:33 +02:00