997 Commits

Author SHA1 Message Date
Kræn Hansen
1228c22b7d Updated the paths in the iOS projects to point at the shared files 2017-08-15 11:53:18 +02:00
Yavor Georgiev
fb7f11263c Modernize V8 ArrayBuffer usage (#1198)
Instead of manually allocating a chunk of memory and asking V8 to create an ArrayBuffer around it, have V8 create an ArrayBuffer with its own allocator and copy the data in it. (fixes #1197)

Remove an extra copy when reading data from ArrayBufferViews.

Remove TODOs for Node.js versions older than 4.
2017-08-10 11:45:48 +02:00
Yavor Georgiev
b71eec6b98
[1.10.1] Bump version 2017-08-02 14:07:16 +02:00
Yavor Georgiev
22a086859f
[1.10.0] Bump version 2017-07-12 16:45:35 +02:00
Yavor Georgiev
5dd9264225
Add Realm.empty 2017-07-12 13:02:21 +02:00
Yavor Georgiev
1e58351ace
Don’t enter node::MakeCallback if we have a calling context
this means we already have JavaScript frames on the execution stack
2017-07-11 17:47:10 +02:00
Yavor Georgiev
fe756bdc86
Rethrow callback errors as fatal Node.js errors
Instead of rethrowing the JavaScript error emitted from a callback function, we should instead pass it to `node::FatalException`.

Callbacks are employed when there is no other JavaScript frame on the stack prior so rethrowing the JS error as a C++ exception is not going to propagate the error back to JavaScript. `node::FatalException` will raise the `uncaughtError` event on the `process` object , print the error and stacktrace, and alert the debugger is there is one attached. This would make our async callbacks behave consistently with Node’s own async callbacks such as `setTimeout` when encountering an error.
2017-07-11 17:47:09 +02:00
Yavor Georgiev
7b9c4eee46
[1.9.0] Bump version 2017-07-10 17:26:44 +02: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
Mark Rowe
89149c0a75 Make it possible to assign a List or Results to a List property once more (#1126)
* Make it possible to assign a List or Results to a List property.

The change made in #1069 to improve error messages when values of
incorrect types were assigned to a given property was being too
narrow in the types it accepted for list properties, allowing only
arrays. Lists and Results are now accepted once more.

* Update CHANGELOG.md
2017-07-10 13:45:49 +02:00
Yavor Georgiev
02c19bacb2 Close uv handles on the loop thread (#1125) 2017-07-07 14:50:34 +02:00
Marius Rackwitz
9e0a9a3bd3 Add support for accessing linking objects / backlinks (#1101)
* Add support for linkingObjects

* Test linkingObjects

* Borrow names helper from list tests

* include computed properties when serializing the schema for the RN debugger

* add API docs

* review comments

* 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.

* [1.8.3] Bump version

* add linkingObjects method to Realm.Object

* changelog
2017-06-29 11:59:10 +02:00
blagoev
f54487c6cc Rename the progress function to better reflect purpose
refactored registration code to remove the unneccesary lambda
2017-06-28 15:02:28 +03:00
blagoev
97f25cc1ab Add progress notifications
Support download progress notifications for Realm open and openAsync methods
2017-06-28 13:40:35 +03:00
Yavor Georgiev
1adabdd73e
[1.8.3] Bump version 2017-06-27 20:38:39 +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
e6818d693d
[1.8.2] Bump version 2017-06-26 13:49:50 +02:00
astigsen
db4e184524 Added method to find index of object in collections (#1094)
* Added method to find index of object in collections

* rework as the indexOf method
2017-06-26 13:43:49 +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
feba70333b
[1.8.1] Bump version 2017-06-20 16:27:05 +02:00
Mark Rowe
30e58022cf Include property names in type error exceptions thrown by Realm.create (#1069)
* Add and adopt `Value::is_binary` / `Value::to_binary` / `Value::from_binary`.

These methods allow conversions between `BinaryData` and the equivalent
JavaScript types without using `NativeAccessor`. Instead,
`NativeAccessor` now itself delegates to these methods.

* Have `NativeAccessor::value_for_property` and `RealmObjectClass::set_property`
verify that values are valid for the property in question.

If not, we throw an exception that includes the name and type of the
property in question.

`NativeAccessor` is changed to always hold a reference to a `Realm` and
an `ObjectSchema` in order to make this validation possible.

* Fix the Windows build.

* Remove an unused, incorrect forward declaration of a template class
  named `Realm` that caused ambiguity with object store's `Realm` class.
* Disambiguate between `realm::js::PropertyType` and
  `realm::PropertyType`.

* Update CHANGELOG.md
2017-06-20 14:40:01 +02:00
Adam Fish
37dba6bb36 Add objectSchema method to Realm Object (#1055)
* Add objectSchema property to Realm Object

* fix
2017-06-20 11:42:43 +02:00
Yavor Georgiev
28fe678a1b Use an uncached realm instance for _waitForDownload (#1083)
Fixes #1061
2017-06-19 13:58:19 +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
Yavor Georgiev
0f5d6a1df4
[1.8.0] Bump version 2017-06-15 16:27:43 +02:00
Adam Lebsack
fdc9414013 Use sync 1.10.0 (#1068) 2017-06-15 15:50:00 +02:00
Mark Rowe
98d57a34ce Update to core v2.8.1 and sync v1.9.x.
FIXME: We'll need to update to sync v1.9.2 once it is available as
v1.9.1 does not include core v2.8.1. This may result in the missing
symbols on Linux problem only being fixed when sync is disabled.
2017-05-23 11:52:43 -07:00
Mark Rowe
b108d06231 Use int64_t rather than long long as the integer type in the accessor
implementation.

This matches what core uses for integers, and avoids ambiguity that
otherwise results when `int64_t` is declared as `long` rather than `long long`.
2017-05-22 20:17:35 -07:00
Mark Rowe
75f8b28831 Fix the Node build.
Tweak the signature on some of the accessor methods to take
`JSEngine::Value`s by value rather than by const reference. Some Node
APIs appear to assume that only non-const objects will be used.
2017-05-22 16:19:15 -07:00
Mark Rowe
66da78af74 Merge remote-tracking branch 'origin/master' into tg/object-accessor-updates 2017-05-22 14:39:55 -07:00
Mark Rowe
43200b1db5 Update the recently-added RealmClass::wait_for_download_completion to
use the new object accessor interface.
2017-05-22 14:33:39 -07:00
kristiandupont
401a6043bf [1.3.1] Bump version 2017-05-18 13:13:28 +02:00
Thomas Goyne
08052e12f6 Update to work with new API for arrays of primitives 2017-05-17 11:02:45 -07:00
blagoev
be328accb4 Merge pull request #1021 from realm/download-api-3
Download API with fixes for windows build
2017-05-17 20:07:00 +03:00
blagoev
cf8e6efb16 fix build for no sync on windows 2017-05-17 16:10:20 +03:00
blagoev
158b513a12 Cleaner error checking 2017-05-17 16:10:00 +03:00
blagoev
cb72fe1977 addressed pr review comments 2017-05-17 16:09:48 +03:00
blagoev
be0611a255 Pass the error code and message to user code 2017-05-17 16:08:55 +03:00
blagoev
315b8c1a7a Fix download api to wait correctly using schema less realm
Added tests using two processes (nodes only)
2017-05-17 16:08:01 +03:00
blagoev
216484aede Initial download api support 2017-05-17 16:07:08 +03:00
blagoev
4751aca0dc Fix event_loop_dispatcher 2017-05-17 16:06:21 +03:00
blagoev
33bb01be11 Fix EventLoopDispatcher
Fixes callback not called due to dispatcher freed when instance go out of scope. Preserves the EventLoopSignal if there are pending invocations
2017-05-17 16:05:46 +03:00
blagoev
018afe6207 Revert "Download api (aka open async api)" 2017-05-17 15:12:30 +03:00
blagoev
8258e184f4 Merge pull request #1005 from realm/download-api
Download api (aka open async api)
2017-05-17 14:29:42 +03:00
blagoev
b100e782cb Cleaner error checking 2017-05-16 12:11:23 +03:00
blagoev
ab626253e5 addressed pr review comments 2017-05-15 15:33:53 +03:00
blagoev
1ae58780bf Pass the error code and message to user code 2017-05-12 01:40:15 +03:00
blagoev
6cd8eefe5d Fix download api to wait correctly using schema less realm
Added tests using two processes (nodes only)
2017-05-11 23:22:28 +03:00
kristiandupont
a916958941 [1.3.0] Bump version 2017-05-11 14:34:52 +02:00