Radu Tutueanu
ca0fd78cee
Do not build node with sync by default
2016-11-15 13:49:41 +01:00
Ari Lazier
eef8a2de3b
property clean up sync state between tests in c++
2016-11-12 05:26:37 -08:00
Ari Lazier
011f293d13
Merge branch 'al-sync-user-tests' of https://github.com/realm/realm-js into al-sync-user-tests
2016-11-11 17:54:04 -08:00
Ari Lazier
e4d4cbbdf3
proper fix/hack removal, partially working sync for rn
2016-11-11 17:53:58 -08:00
Ari Lazier
41b0426e01
Merge pull request #652 from realm/rt/improve-build
...
Improve build
2016-11-11 16:31:48 -08:00
Ari Lazier
043d801bb7
fix for node
2016-11-11 15:33:13 -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
Radu Tutueanu
e268cfef58
Add variable to enable skipping the download
2016-11-11 17:39:07 +01: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
08ffc3bf15
ccache support
2016-11-10 23:55:26 -08:00
Ari Lazier
30679c2470
remove unneeded script phases
2016-11-10 15:54:24 -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
0495c1f906
fixed object store
2016-11-10 08:51:14 -08:00
Ari Lazier
3b91ca94f4
use updated object store
2016-11-10 06:58:03 -08:00
Ari Lazier
6a257d594e
only npm install actual dependencies
2016-11-10 04:42:07 -08:00
Ari Lazier
c5c451ed18
remove invalid resource
2016-11-10 04:23:34 -08:00
Ari Lazier
3e37795d62
fix for unregistering notifications in a notification
2016-11-09 18:01:56 -08:00
Ari Lazier
85c655a91c
fix for constructor destruction after timeout
2016-11-09 17:46:26 -08:00
Ari Lazier
4fc874f35c
some small fixes for download-core script
2016-11-09 15:01:42 -08:00
Radu Tutueanu
9833b8e490
Build macOS with sync by default
2016-11-09 19:07:26 +01:00
Radu Tutueanu
c995253202
Fix building with sync
2016-11-09 17:25:25 +01:00
Radu Tutueanu
ba48933561
Enable building without sync
...
This is needed because the linux node binding needs to work without sync
2016-11-09 16:47:17 +01:00
Ari Lazier
42cab3a95a
update submodule
2016-11-08 15:07:57 -08:00
Ari Lazier
8ce8f52105
add test for login
2016-11-08 14:07:04 -08:00
Ari Lazier
5a49dbc325
make sync work with RealmJS tests
2016-10-27 13:49:41 -07:00
Ari Lazier
60d9da1b44
remove unneded server argument for adminUser, update care and sync dependencies
2016-10-26 17:20:34 -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
Ari Lazier
c49727913c
update to public object store
2016-10-26 17:00:46 -07:00
Ari Lazier
5e1ecdf19e
default the schema version to 0 when a schema is provided
2016-10-26 17:00:33 -07:00
Ari Lazier
18c419fb96
don't set version to 0 when not set
2016-10-26 17:00:33 -07:00
Ari Lazier
e05ef29e4f
update object store
2016-10-26 16:30:00 -07:00
Ari Lazier
0d74c05366
add sync cleanup method
2016-10-25 15:04:58 -07:00
Yavor Georgiev
c3e082616e
Use latest object store
2016-10-25 00:46:49 +02:00
Yavor Georgiev
b2d7d66b90
remove UvAsync
2016-10-12 01:15:27 +02:00
Yavor Georgiev
f5d396a93c
remove the global notifier from object store
2016-10-12 00:54:13 +02:00
Yavor Georgiev
a37fe03e20
bring back node ci
2016-10-11 22:30:39 +02:00
Yavor Georgiev
33b87e6582
remove the node sync logger
2016-10-11 01:33:10 +02:00
Yavor Georgiev
245328009a
expose the node class constructor
2016-10-11 00:38:32 +02:00
Yavor Georgiev
3a8ed6cbe6
fix linux build. again.
2016-10-10 18:09:25 +02:00
Yavor Georgiev
28924b4f99
Build the node addon as a static library
2016-10-10 14:20:54 +02:00
Yavor Georgiev
0ff7357cc3
Build for node without sync
2016-10-10 14:20:33 +02:00
Yavor Georgiev
5623653477
prepare for the glorious future
2016-10-08 19:36:03 +02:00
Ari Lazier
857369f5a4
download core and sync and get the test app running on sync
2016-10-04 17:27:09 -07:00
Ari Lazier
9d0df0de3d
Sync and fine grained notifications
2016-10-04 15:07:14 -07:00
Ari Lazier
876417716f
Merge pull request #567 from realm/al-latest
...
Update changelog/version on master
2016-08-19 06:55:17 -07:00
Mark Rowe
5b888ed91d
Update to core 1.5.0 and the latest version of the object store.
2016-08-15 11:29:58 -07:00
Ari Lazier
3e55944818
[0.14.3-rc] Bump version
2016-08-15 11:12:36 -07:00
Mark Rowe
b08db9f768
Merge pull request #548 from realm/mar/object-store-as-submodule
...
Switch to pulling the object store in as a submodule
2016-08-02 11:34:29 -07:00
Ari Lazier
1522fb3689
Merge pull request #523 from realm/al-rn-29
...
Support latest react-native version
2016-08-02 09:59:57 -07:00
Thomas Goyne
f8ed437003
Update the binding for object store API changes
2016-08-02 09:31:25 -07:00
Mark Rowe
b62a5e6d99
Pull in the object store as a submodule.
2016-08-02 09:25:17 -07:00
Ari Lazier
ad97836d19
[0.14.2] Bump version
2016-07-31 14:25:13 -07:00
Yavor Georgiev
6a6ed5a214
Get the path to nan relatively
...
Under npm3 the `realm` and `nan` modules might end up as siblings so the best way to get the path to `nan` is to require it from within the `realm` module. The `nan` module prints its path so it can be captured by an external build system like in this patch.
2016-07-21 17:39:03 +02:00
Thomas Goyne
a4c8d745cf
Use List::snapshot()
2016-07-18 14:42:10 -07:00
Thomas Goyne
b59af706ea
Update binding code for API changes
2016-07-18 14:15:25 -07:00
Yavor Georgiev
9320be158c
Allow for non-nullterminated object type names ( #97 )
...
`StringData::data()` returns the underlying buffer, which might not be null-terminated, so the resulting string from appending to `"class_"` has garbage in the end. Use the `std::string` conversion of `StringData` because it takes the size of the string into account.
2016-07-18 14:15:25 -07:00
Thomas Goyne
847b6852c9
Change the API-misuse exceptions from runtime_error to logic_error
2016-07-18 14:15:25 -07:00
Mark Rowe
11018952e9
Change API misuse exceptions in object_accessor.hpp to derive from `std::logic_error` rather than `std::runtime_error`.
...
Also includes the following minor changes:
* Renames `ReadOnlyPropertyValueException` to
`ReadOnlyPropertyException` since it's the property that's read-only,
not the value.
* Elminiates some unnecessary copies of arguments passed to the
exception constructors.
* Makes the exception type data members public, since otherwise there's
no point in storing them at.
2016-07-18 14:15:25 -07:00
Mark Rowe
00e4790353
Have `List` and `Results` fetch their object schema when requested.
...
This avoids the need to eagerly fetch the object schema in order to
construct a `List` or `Results`. Instead the work can be deferred until
the object schema is requested. Since `List` and `Results` never use the
object schema themselves this can avoid unnecessary work in some bindings.
2016-07-18 14:15:25 -07:00
Mark Rowe
f529ec9f58
Fix a typo in the name of a #define.
2016-07-18 14:15:25 -07:00
Mark Rowe
f00eb4f52d
Enable clang's warning about implicit fallthrough.
2016-07-18 14:15:25 -07:00
Mark Rowe
ac2223b32d
Fix compiler checks to match clang on OS X, which CMake labels AppleClang.
2016-07-18 14:12:58 -07:00
Mark Rowe
c756045871
Perform extra synchronization the first time `TsanNotifyWorker` hands a `RealmCoordinator` to the worker thread.
...
This prevents TSan from reporting data races on members of the coordinator.
2016-07-18 14:12:58 -07:00
Mark Rowe
7c0b99594a
Replace `Results::set_live` with `Results::snapshot` and `List::snapshot`, and add tests.
...
`snapshot()` functions are a better fit for what realm-js needs. The new
API also makes it clearer that the liveness of a given `Results`
cannot change at arbitrary times. Changing the liveness at arbitrary
times was not safe and could result in incorrect behavior, such as a
non-live `Results` changing.
2016-07-18 14:12:58 -07:00
Mark Rowe
8798b1c617
Remove workaround for a core issue fixed in core v1.2.0.
2016-07-18 14:12:57 -07:00
Kristian Dupont
edf53a1750
Specify width of PropertyType to 1 byte
2016-07-18 14:12:57 -07:00
Thomas Goyne
8293675bd6
Update to core 1.2.0
2016-07-18 14:12:57 -07:00
Thomas Goyne
aaa811306e
Resolve trivial differences with realm-cocoa
2016-07-18 14:12:57 -07:00
Thomas Goyne
bdc8dbc5b2
Enable more warnings (and fix them)
...
This brings the warnings settings in line with realm-cocoa's.
2016-07-18 13:40:08 -07:00
Scott Kyle
63adf8732e
[0.14.0-rc] Bump version
2016-06-28 12:15:36 -07:00
Scott Kyle
6109675749
Disable "Strip Linked Product" on our static libs
...
There seems to a bug inside the `strip` command (or its `ld64` library) that is being triggered by some users who get this message: `Assertion failed: (0 && "need to handle arm64 -r reloc")`
It is reported that disabling this setting side-steps the issue, and we don't need any stripping done on the static library itself.
Fixes #503
2016-06-28 12:13:58 -07:00
Scott Kyle
e8ea8e493e
Fix for linker error when building for iOS 7
...
By default, React Native projects target a minimum of iOS 7, but our projects were set to iOS 8 because previously we used a dynamic framework.
When building for an iOS 7 minimum target version, the linker would complain about thread local variables not working on iOS 7. So it was necessary to add even more checks (iOS >= 8 or OS X >= 10.7) before using native thread local variables rather than our shim.
This also changes our projects to target iOS 7 so we can catch these issues quicker in the future.
2016-06-27 12:16:35 -07:00
Ari Lazier
7d42d26fe9
quote dir path
2016-06-20 12:02:55 -07:00
Ari Lazier
5488eff9b9
recursively delete management directories
2016-06-20 11:41:18 -07:00
Ari Lazier
5eb64025f9
remove management directories in node
2016-06-20 10:49:53 -07:00
Scott Kyle
adc07fdd7f
Remove files accidentally added to GCDWebServers target
...
Not sure when this happened!
2016-06-17 13:16:01 -07:00
Scott Kyle
928ab03ce4
Update to download and use core build for Node
...
This will need to be updated again with a newer version since 1.1.2 build was created on CI but is not actually on static.realm.io until a new release is made.
2016-06-17 11:19:19 -07:00
Scott Kyle
12517a0d1e
Add ability to run Node tests on Linux
...
It uses the Android ExternalCommitHelper implementation.
The Dockerfile requires that you have a static library build of core for Linux with PIC enabled.
2016-06-17 02:38:33 -07:00
Scott Kyle
dc3d88f053
[0.14.0-rc] Bump version
2016-06-16 17:55:45 -07:00
Scott Kyle
55aa3d0702
Fix thread_local.hpp to compile with GCC
2016-06-16 17:32:11 -07:00
Scott Kyle
13ab8f8111
Refactor thread_id.hpp into cpp and thread_local.hpp
2016-06-16 17:02:53 -07:00
Scott Kyle
b55483d2d9
Emulate thread_local for older iPhone targets
...
It seems that Xcode clang will not even support __thread for iPhone 5 and older, so this includes a simple abstraction over pthread keys in that case.
2016-06-16 17:02:53 -07:00
Scott Kyle
446cb0245e
Fix bug due to std: 🧵 :id being reused
...
After a thread is destroyed, a thread id might be reused. This is true for pthread_self() and hence std:🧵 :id. We were hitting this in Chrome debug mode because the "worker" thread was being destroyed and a new one immediately created when reloading. The thread id would be the same, and therefore we'd get back the SharedRealm for the previously destroyed thread (which had yet to be garbage collected.
The new implementation uses an atomically incremented, thread-local identifier, which serves our needs very well.
Fixes #473
2016-06-16 17:02:53 -07:00
Scott Kyle
a335d7bbc8
The DEBUG macro is now defined at the project level
2016-06-15 01:19:19 -07:00
Scott Kyle
44fc1a4b36
Change RealmJS to use regular and debug cores
...
Bitcode build went away.
2016-06-14 18:04:12 -07:00
Scott Kyle
d26edff0f5
Add format.cpp to Xcode Node build
2016-06-14 17:42:41 -07:00
Scott Kyle
af52e9f437
Make stuff build for Node and Android
2016-06-14 17:22:04 -07:00
Ari Lazier
2e3b95f2e7
merge latest master
2016-06-14 16:40:57 -07:00
Ari Lazier
f0b533c75f
add util back to header path
2016-06-14 15:11:19 -07:00
Ari Lazier
08dd1a41be
always invalidate newly opened realms
2016-06-14 14:36:27 -07:00
Ari Lazier
81a32909c1
update to latest object store changes
2016-06-14 14:33:27 -07:00
Ari Lazier
5b8f43dca2
get latest from os branch
2016-06-14 13:51:40 -07:00
Scott Kyle
6d524107e0
Silence warnings about member function pointers
...
The base ClassDefinition defines its constructor member as null, but some subclass have a static constructor function. This allows both cases to be handled without a warning.
2016-06-13 17:24:43 -07:00
Scott Kyle
43f7329047
Remove confusing, unnecessary typedef
...
This is not used anywhere.
2016-06-13 17:24:43 -07:00
Scott Kyle
9bcb30e86d
Add missing source files to RealmNode target
2016-06-13 17:24:43 -07:00
Ari Lazier
c7e156a7b8
Merge pull request #488 from realm/al-typos
...
fixes for typos and added upsert test
2016-06-13 14:51:53 -07:00
Ari Lazier
0a4e0665ae
fixes for typos and added upsert test
2016-06-13 14:46:26 -07:00
Ari Lazier
3901bf53dc
Merge pull request #479 from realm/al-muti-realm
...
fix for setting properties to objects from other realms
2016-06-13 14:44:28 -07:00
Scott Kyle
6aa9825cd1
Merge pull request #469 from realm/sk-object-store-merge
...
Merge latest object store (includes Android async stuff)
2016-06-13 14:38:28 -07:00
Ari Lazier
2b48ebb30a
negate if statements
2016-06-13 14:07:50 -07:00
Kenneth Geisshirt
57a1015b85
Killing a few gcc warnings ( #88 )
...
* killing a few gcc warnings
2016-06-13 09:31:41 +02:00
Scott Kyle
cd20d870dd
Fix crash from querying with object from another Realm
2016-06-09 15:32:37 -07:00
Scott Kyle
cdcb99a502
Improvements from PR feedback
2016-06-09 13:07:05 -07:00
Ari Lazier
81feca0ce9
fix for setting properties to objects from other realms
2016-06-08 11:22:12 -07:00
Mark Rowe
7f1be608f3
Merge pull request #85 from realm/mar/cocoa-list
...
Pull in changes to List from realm-cocoa
2016-06-07 15:45:08 -07:00
Thomas Goyne
5054bbc1a2
Add the path of the Realm file to the config mismatch exception message
2016-06-06 15:30:57 -07:00
Thomas Goyne
bd0913bc03
Pull in changes to `List` from realm/realm-cocoa@355657f168 .
2016-06-06 15:09:26 -07:00
Mark Rowe
152697d199
Add the linking objects property type.
2016-06-06 11:49:29 -07:00
Mark Rowe
abca7c26e1
Add support for the concept of computed properties.
2016-06-06 11:41:34 -07:00
Chen Mulong
64e733e4d7
Fix compile errors for NDK ( #82 )
...
make_unique<TableView> causes ambiguous call with NDK's default gnustl.
Compiler fails to decide which constructor of Query to use.
2016-06-06 18:27:05 +08:00
Scott Kyle
cd0bb079b7
Implement objectForPrimaryKey() method
...
Resolves #328
2016-06-03 16:51:32 -07:00
Scott Kyle
cb889ea8f8
Merge pull request #466 from realm/sk-remove-gcov-config
...
Remove unused GCov_Build configuration
2016-06-03 16:04:29 -07:00
Thomas Goyne
f4e5049f47
Add basic string formatting for error messages
...
The main motivation for this is that building error messages via string
concatenation is tedious and makes it hard to judge what the actual message
looks like when there are a lot of parts being inserted, to the extent that
I've been tempted to leave out some potentially useful information because the
code was getting unwieldy.
It also has some small functional benefits: bools are printed as true/false
rather than 1/0, and it is optimized for minimizing the compiled size.
Currently it cuts ~30 KB off librealm-object-store.dylib even with the addition
of new functionality.
2016-06-03 13:19:42 -07:00
Ari Lazier
49fd092cae
Fix for whitespce
2016-06-02 22:05:17 -07:00
Mark Rowe
57ee591809
Merge pull request #78 from realm/mar/weakrealmnotifier-leak
...
Fix a potential leak within WeakRealmNotifier
2016-06-01 13:07:56 -07:00
Mark Rowe
8685390345
Merge pull request #77 from realm/mar/results-leak
...
Fix move-assigning to a Results that has a notifier to not leak the Realm
2016-06-01 13:07:45 -07:00
Thomas Goyne
6d22d28fea
Merge pull request #72 from realm/tg/core-1.0.0
...
Upgrade to core 1.0.0 and update the file exception translation to match
2016-06-01 12:02:27 -07:00
Mark Rowe
08404d7098
Express `Results`' asignment operators in terms of their equivalent
...
constructors.
This avoids having to repeat the move constructor's logic in the move
assignment operator, and allows the copy assignment operator to compile
despite `TableViewBase`'s missing copy assignment implementation. the
copy assignment implementation can be defaulted once `TableViewBase` is
fixed.
2016-06-01 11:50:25 -07:00
Mark Rowe
3e952269da
Have `Results` default its copy constructor.
...
The custom implementation was an attempt to ensure that
`m_has_used_table_view` and `m_wants_background_updates` had appropriate
intial values. Thomas pointed out that we can remove the reliance on the
initial values by ensure that `prepare_async` sets
`m_wants_background_updates`, removing the need for a custom copy
constructor.
2016-06-01 11:48:35 -07:00
Mark Rowe
fc63c4f67b
Merge pull request #76 from realm/mar/fix-building-tests-in-xcode
...
Fix building tests in Xcode
2016-06-01 11:40:14 -07:00
Mark Rowe
2a75edde8e
Move `List`s defaulted constructors and assignment operators out of line.
2016-06-01 11:29:32 -07:00
Scott Kyle
b5853c2590
Merge remote-tracking branch 'object-store/master' into sk-object-store-merge
...
* object-store/master:
Make Realm::is_closed() work on read-only instances
Fix for object store build issues on Android
Implement commit helper and realm notifier for Android (#69 )
Build both dynamic and static libraries.
moving pegtl dependency as step 1 in install doc
update docu (install procedure)
2016-06-01 10:14:16 -07:00
Mark Rowe
702b8a31fb
Avoid leaking the runloop and source if WeakRealmNotifier is move-assigned.
2016-05-31 21:54:40 -07:00
Mark Rowe
65a748de0c
Fix move-assigning to a `Results` that has a notifier to not leak the
...
`Realm`, and moving from a `Results` to not result in a use-after-free.
The compiler generated move-assignment operator resulted in `m_notifier`
being assigned to without first calling `CollectionNotifier::unregister`.
This left a retain cycle in place, causing the `Realm` and other objects
to leak.
`ResultsNotifier` keeps track of which `Results` it should update when a
new `TableView` becomes available. When `Results` move-assignment
operator and move-constructor transfer ownership of the
`ResultsNotifier` to a new instance they also need to update its target
so it won't attempt to update the moved-from `Results`.
2016-05-31 19:03:29 -07:00
Mark Rowe
7e99634567
Fix building tests in Xcode.
...
The Xcode project generated by CMake doesn't create the dylib when built
as the dylib target does not contain any source files. Adding an empty
placeholder .cpp file to the target is sufficient to convince Xcode to
produce the dylib.
2016-05-31 17:16:52 -07:00
Mark Rowe
344fc42d4e
Avoid copying `Object` unnecessarily.
2016-05-31 15:54:43 -07:00
Mark Rowe
efdf0e01a9
Avoid copying `List` unnecessarily.
2016-05-31 15:27:48 -07:00
Scott Kyle
3b9b8cbc75
Remove unused GCov_Build configuration
...
We've never really used this, so let's remove it until we ever actually need something like this.
2016-05-31 11:30:24 -07:00
Scott Kyle
385fe97861
Make Realm::is_closed() work on read-only instances
2016-05-31 11:27:39 -07:00
Scott Kyle
7bb8a04359
Fix for object store build issues on Android
2016-05-31 11:11:39 -07:00
Scott Kyle
560e725398
Address some issues in WeakRealmNotifier for Node
2016-05-31 10:05:14 -07:00
Yavor Georgiev
91c87e4de6
Implement commit helper and realm notifier for Android ( #69 )
...
* Implement commit helper and realm notifier for Android
* Remove non-existent include
* Shut down the current instance when move-assigning
* Only use Android logging when on Android
* Cleanup realm_ptr when it hasn't been sent over the pipe
* Assed that WeakRealmNotifier is closed on the thread it was created on
* Typo
* Fix syntax error
* changes after code review
* Use the proper preprocessor definition for Android
* Pass the correct address to write(2)
* Explicitly handle looper events
* changes after code review
* Do not return after handling ALOOPER_EVENT_HANGUP
* Handle HANGUP after INPUT
2016-05-31 17:15:32 +02:00
Ari Lazier
df040c7d99
fix for comment
2016-05-27 16:25:33 -07:00
Ari Lazier
7829cb5f33
fix for comment
2016-05-27 16:25:33 -07:00
Ari Lazier
38c6eb7b6b
more pr feedback
2016-05-27 16:03:03 -07:00
Ari Lazier
3e74cd98d5
more pr feedback
2016-05-27 16:03:03 -07:00
Ari Lazier
9fe636b614
pr feedback
2016-05-27 15:50:33 -07:00
Ari Lazier
e316b54eff
pr feedback
2016-05-27 15:50:33 -07:00
Ari Lazier
9012549c5d
object store pr feedback
2016-05-27 15:45:56 -07:00
Ari Lazier
ceceeab9a5
object store pr feedback
2016-05-27 15:45:56 -07:00
Scott Kyle
b3ec066d12
Merge pull request #451 from realm/sk-test-improvements
...
Improve JS tests
2016-05-27 13:56:49 -07:00
Scott Kyle
d05542c031
Merge branch 'sk-node-notifier'
...
* sk-node-notifier:
Create a HandleScope before calling callbacks
Add a working WeakRealmNotifier for Node
2016-05-27 13:25:50 -07:00
Scott Kyle
8a52cf8ffe
Merge branch 'sk-node-notifier'
...
* sk-node-notifier:
Create a HandleScope before calling callbacks
Add a working WeakRealmNotifier for Node
2016-05-27 13:25:50 -07:00
Scott Kyle
4e457526bb
Merge branch 'sk-node-xcode'
...
* sk-node-xcode:
Consolidate RealmNode.xcodeproj into RealmJS.xcodeproj
2016-05-27 13:20:01 -07:00
Scott Kyle
5a3997d268
Fix for consecutive calls to clearTestState()
...
This bug would only happen from Chrome debug mode, where consecutive calls would crash the app because the m_objects iterator would be in a bad state. This method is faster anyways.
2016-05-26 17:58:24 -07:00
Scott Kyle
78a8311ba6
Merge branch '0.13.x'
...
* 0.13.x:
[0.13.2] Bump version
fix for upgrading optional date properties
2016-05-26 14:36:17 -07:00
Mark Rowe
f19bab76bd
Build both dynamic and static libraries.
...
The dynamic library makes it easy to verify that there are no linker
errors when building the object store, while the static library is
easier for a binding to consume.
This also tweaks how the library targets are defined to ensure that
other CMake projects that pull in the libraries automatically get the
right include paths and link to the appropriate libraries.
2016-05-26 13:41:52 -07:00
Scott Kyle
118567ca4e
[0.13.2] Bump version
2016-05-26 13:35:29 -07:00
Ari Lazier
027d4fd153
fix for upgrading optional date properties
2016-05-26 13:30:51 -07:00
Scott Kyle
39f0661535
Factor out padding rule for operators
2016-05-26 11:57:43 -07:00
Scott Kyle
1a192240df
Factor out padding rule for operators
2016-05-26 11:57:43 -07:00
Scott Kyle
d7474cabc6
Improve parsing of string tokens
...
All of the parsing behavior was confirmed to be compatible with the NSPredicate parser.
2016-05-26 01:04:41 -07:00
Scott Kyle
44576dd285
Improve parsing of string tokens
...
All of the parsing behavior was confirmed to be compatible with the NSPredicate parser.
2016-05-26 01:04:41 -07:00
Scott Kyle
ea4c4fe6f9
Merge branch '0.13.x'
...
* 0.13.x:
[0.13.1] Bump version
Fix crash and other errors with Results snapshots
fix for negative timestamps
2016-05-24 12:38:32 -07:00
Scott Kyle
47776d9b0a
[0.13.1] Bump version
2016-05-24 11:53:10 -07:00
Scott Kyle
f8ba388d14
Fix crash and other errors with Results snapshots
...
When deleteAll() is called on a Realm, it calls clear() on all of its Tables, which seems to not update TableViews unless they are synced. The is_row_attached(row_ndx) method still returns true otherwise. A workaround is here until that is fixed.
Fixes #434
2016-05-24 11:52:02 -07:00
Ari Lazier
9e05728dce
fix for negative timestamps
2016-05-24 11:45:16 -07:00
Scott Kyle
7740665d7d
Merge pull request #449 from realm/sk-crash-fix
...
Fix crash and other errors with Results snapshots
2016-05-24 11:02:53 -07:00
Scott Kyle
20b121c57d
Add FIXME referencing core issue
2016-05-24 10:42:17 -07:00
Scott Kyle
cb399e54e4
Add FIXME referencing core issue
2016-05-24 10:42:17 -07:00
Ari Lazier
47a279cc67
use mod
2016-05-24 08:25:44 -07:00
Ari Lazier
604fcc73f2
fix for negative timestamps
2016-05-24 08:23:21 -07:00
Thomas Goyne
840c46f8f3
Upgrade to core 1.0.0 and update the file exception translation to match
...
File::AccessError is now thrown for all file-related exceptions which don't
have more specific types (rather than std::runtime_error), which requires some
changes to how exception messages are built when translating them to get nice
results.
Also add `Realm::write_copy()` which just wraps `Group::write()` with error
translation.
2016-05-23 10:28:04 -07:00
Scott Kyle
2672cd901f
Fix crash and other errors with Results snapshots
...
When deleteAll() is called on a Realm, it calls clear() on all of its Tables, which seems to not update TableViews unless they are synced. The is_row_attached(row_ndx) method still returns true otherwise. A workaround is here until that is fixed.
Fixes #434
2016-05-20 13:42:17 -07:00
Scott Kyle
e14e922c39
Fix crash and other errors with Results snapshots
...
When deleteAll() is called on a Realm, it calls clear() on all of its Tables, which seems to not update TableViews unless they are synced. The is_row_attached(row_ndx) method still returns true otherwise. A workaround is here until that is fixed.
Fixes #434
2016-05-20 13:42:17 -07:00
Scott Kyle
858d67125d
Consolidate RealmNode.xcodeproj into RealmJS.xcodeproj
...
Moved it up one level since it references the whole source tree inside the src/ directory. Added the functionality to run Node tests from Xcode on the existing RealmNode target.
2016-05-19 14:50:27 -07:00
Scott Kyle
5198a5bf4b
Create a HandleScope before calling callbacks
2016-05-19 14:49:21 -07:00
Scott Kyle
5ecf13c261
Create a HandleScope before calling callbacks
2016-05-19 14:49:21 -07:00
Scott Kyle
938c7fb2f4
Add a working WeakRealmNotifier for Node
...
Uses libuv APIs to async schedule onto the default Node run loop.
2016-05-19 14:49:21 -07:00
Scott Kyle
2eacb66ac4
Add a working WeakRealmNotifier for Node
...
Uses libuv APIs to async schedule onto the default Node run loop.
2016-05-19 14:49:21 -07:00
Ari Lazier
3b6ee92224
merge master
2016-05-19 14:08:42 -07:00
Ari Lazier
1ff7c49bdb
merge master
2016-05-19 14:08:42 -07:00
Ari Lazier
50c7b6245f
make unique ptr manually
2016-05-19 14:06:14 -07:00
Ari Lazier
a81627b1d0
make unique ptr manually
2016-05-19 14:06:14 -07:00
Ari Lazier
7f5ca3cee7
fix tab
2016-05-19 13:59:50 -07:00
Ari Lazier
b06d93a27d
node fixes
2016-05-19 13:35:06 -07:00
Ari Lazier
9c7292acff
chrome debug and and react native fixes
2016-05-19 13:27:36 -07:00
Scott Kyle
ea697f9904
Include comment about string_operator_t
2016-05-19 13:12:40 -07:00
Scott Kyle
cfc96995b4
Include comment about string_operator_t
2016-05-19 13:12:40 -07:00
Scott Kyle
db7cfc0f5d
Add a few more parser tests
2016-05-19 13:08:39 -07:00
Ari Lazier
fc794bbf31
pr fixes
2016-05-19 12:22:07 -07:00
Ari Lazier
8709f04e8b
pr fixes
2016-05-19 12:22:07 -07:00
Scott Kyle
6c0608356a
Allow key paths to start with "not" in queries
...
Fixes #445
2016-05-19 01:26:13 -07:00
Scott Kyle
60723269ec
Allow key paths to start with "not" in queries
...
Fixes #445
2016-05-19 01:26:13 -07:00
Ari Lazier
592a35a69e
add isValid methods to results and list
2016-05-16 16:01:14 -07:00
Ari Lazier
fd25afe214
add isValid methods to results and list
2016-05-16 16:01:14 -07:00
Ari Lazier
6af98acd11
combine other classes
2016-05-16 15:43:46 -07:00
Ari Lazier
e76cb3b905
combine class definitions and implementations for list and results
2016-05-16 15:43:46 -07:00
Ari Lazier
5fc79d4e99
apply latest changes from master
2016-05-16 15:37:40 -07:00
Scott Kyle
fb887d92f5
[0.13.0-rc] Bump version
2016-05-16 14:48:08 -07:00
Ari Lazier
0f74101074
Merge pull request #423 from realm/al-timestamp
...
Use new timestamp format
2016-05-16 13:52:31 -07:00
Scott Kyle
eb72459cce
Make sure the right node-gyp is called
2016-05-16 12:57:46 -07:00
Ari Lazier
bd04185772
use const ref for argument
2016-05-16 12:50:29 -07:00
Ari Lazier
4d40896e5e
make method static
2016-05-16 12:45:29 -07:00
Ari Lazier
2f69728827
pr fixes
2016-05-16 11:29:58 -07:00
Scott Kyle
7a26d192ba
Merge pull request #427 from realm/sk-object-inheritance
...
Fix ES6 class inheritance of Realm.Object with Babel
2016-05-16 11:17:45 -07:00
Ari Lazier
df716d3da1
fix for android compilation
2016-05-13 18:45:42 -07:00
Ari Lazier
3d0af084bb
fix for android compilation
2016-05-13 18:45:42 -07:00
Ari Lazier
e438d8b586
update object store
2016-05-13 18:04:05 -07:00
Ari Lazier
0c1fdaadda
update object store
2016-05-13 18:04:05 -07:00
Scott Kyle
5bc72ab2cf
Make Date testing work for Node
2016-05-13 16:30:57 -07:00
Scott Kyle
0b1a686f60
Add platform.cpp file for Node
2016-05-13 16:26:31 -07:00
Ari Lazier
e32df4e815
fix copy bundled files for ios
2016-05-13 15:44:25 -07:00
Ari Lazier
125dd0d1c7
merge it
2016-05-13 15:41:10 -07:00
Ari Lazier
d1dcd4ff3f
add additional tests
2016-05-13 15:29:59 -07:00
Scott Kyle
0250234a30
Cleanup Android platform.cpp
2016-05-13 15:25:18 -07:00
Ari Lazier
e7b341dfdb
merge latest from master
2016-05-13 15:05:19 -07:00
Ari Lazier
4334d55767
fix for android - create notifier after opening realm
2016-05-13 14:55:36 -07:00
Ari Lazier
78f74211b1
fix for android - create notifier after opening realm
2016-05-13 14:55:36 -07:00
Ari Lazier
80904e36e1
hopeful fix for android test
2016-05-13 14:15:34 -07:00
Ari Lazier
0ce3cdf81d
hopeful fix for android test
2016-05-13 14:15:34 -07:00
Scott Kyle
323583ed67
Merge pull request #417 from realm/sk-node-6
...
Fix issues in Node 6
2016-05-12 12:39:31 -07:00
Ari Lazier
299c82b7d2
pr feedback
2016-05-12 11:42:22 -07:00
Thomas Goyne
e6d09b513e
Fix an assertion failure in IndexSet::do_add() following a table clear
...
We don't track insertions and deletions for tables that are merely linked to by
tables actually being observed (for performance reasons, since we don't need
that information), but the check for that was missing in one place. This would
be merely a slowdown rather than a crash, but deletions.add_shifted() can
overflow size_t if the passed-in index represents a newly inserted row and the
check for that didn't work due to not tracking insertions for the table.
The only remotely realistic way to actually have size_t overflow is to have
previously cleared the table (the table clear instruction does not include the
old size of the table, so it just marks {0, SIZE_T_MAX} as deleted).
Fixes #3537 .
2016-05-11 16:08:30 -07:00
Thomas Goyne
2bcf42904a
Fix some typos in comments
2016-05-11 16:08:30 -07:00
Thomas Goyne
b42bf25c99
Fix compilation with latest core
2016-05-11 16:08:30 -07:00
Thomas Goyne
8d9e5db092
Give a variable a less terrible name and add a comment
2016-05-11 16:08:30 -07:00
Mark Rowe
ef1c6ddc63
Add support for fine-grained notifications from backlink TVs
2016-05-11 16:08:30 -07:00
Thomas Goyne
03108713ee
Make PropertyType an enum class
2016-05-11 16:08:30 -07:00
Thomas Goyne
4cf5d5db4c
Report modification paths as pre-delete/inserts as required for UITableView
2016-05-11 16:08:30 -07:00
Thomas Goyne
d8a69b87dc
Improve change calculation performance for nontrivial object graphs
...
Skip doing any checking at all if none of the tables reachable from the root
table have been modified (which can happen if the table version was bumped due
to insertions, unrelated backlinks, or unlinked-to rows being deleted in linked
tables).
Add cycle checking rather than relying on the max depth to handle it, as the
worst case was O(N^16) if the cycle involved a LinkList of size N.
Track which rows have been confirmed to have not been modified.
Cache the information about the links for each of the relevant tables as
checking the table schema can get somewhat expensive.
2016-05-11 16:08:30 -07:00
Thomas Goyne
f9364b50a4
Return the correct iterator from ChunkedVector::erase()
...
When a chunk is removed entirely it should return an iterator to the first
element in the next chunk, not the last.
2016-05-11 16:08:30 -07:00
Thomas Goyne
4df552ba2d
Clean up old move info even when the row being deleted is the last one
2016-05-11 16:08:30 -07:00
Thomas Goyne
3218740fd9
Fix the check for a deleted LV in ListNotifier::add_required_change_info()
2016-05-11 16:08:30 -07:00
Thomas Goyne
632d757014
Always deliver results to the correct SharedGroup
...
If there are multiple Realm instances for a single file on a single thread due
to disabling caching we need to actually deliver the results to the appropriate
SharedGroup for each notifier rather than delivering them all to the first one.
2016-05-11 16:08:30 -07:00
Thomas Goyne
8879212111
Fix assertion failure when a notifier is removed before it runs
2016-05-11 16:08:30 -07:00
Thomas Goyne
eee6e55eb0
Refactor SortedMoveCalculator and add more of an explanation
2016-05-11 16:08:30 -07:00
Thomas Goyne
95900f5e17
Make more member functions in CollectionNotifier pure virtual
2016-05-11 16:08:30 -07:00
Thomas Goyne
9883944df4
Pull CollectionChangeBuilder into its own file
2016-05-11 16:08:30 -07:00
Thomas Goyne
66666a75b0
Iterate backwards to pick the last valid list in select_link_list
2016-05-11 16:08:30 -07:00
Thomas Goyne
23c16f8e67
Use aggregate initialization for the base class in CollectionChangeBuilder
2016-05-11 16:08:30 -07:00
Thomas Goyne
c0350b9001
Rename CollectionChangeIndices to CollectionChangeSet
2016-05-11 16:08:30 -07:00
Thomas Goyne
953e1b15a8
Rename BackgroundCollection to CollectionNotifier
2016-05-11 16:08:30 -07:00
Thomas Goyne
fe5564f40e
Change all of the mentions of 'query' in NotificationToken to 'notifier'
2016-05-11 16:08:30 -07:00
Thomas Goyne
31c3982bff
Fix some typos
2016-05-11 16:08:30 -07:00
Thomas Goyne
e75ff49421
Fix check for the target results being invalid in ResultsNotifier::deliver()
...
m_target_results is no longer actually set to null when the notifier is
unregistered, so check the thing which is (i.e. m_realm).
2016-05-11 16:08:30 -07:00
Thomas Goyne
238e9e3b6b
Fix tracking of which tables need change info with multiple source notifier versions
2016-05-11 16:08:30 -07:00
Thomas Goyne
ea3a2f4711
Refactor the incremental change tracking for mixed source versions
2016-05-11 16:08:30 -07:00
Thomas Goyne
69cefd052e
Deliver the new TableView even if it did not change
...
Even if the new TV has the same rows as the old one, we need to hand it over to
the destination thread to bump the outside version of the destination thread's
TV to avoid rerunning the query there.
2016-05-11 16:08:30 -07:00
Thomas Goyne
83b4d8ded2
Make RealmCoordinator::run_async_notifiers a bit less gross
2016-05-11 16:08:30 -07:00
Thomas Goyne
32b05314f5
Remove extraneous semicolons
2016-05-11 16:08:30 -07:00
Thomas Goyne
2ce0e2e37f
Remove transaction log handlers for old pk functions
2016-05-11 16:08:30 -07:00
Thomas Goyne
c12d87427a
Clean up includes and forward declarations a bit
2016-05-11 16:08:30 -07:00
Thomas Goyne
155d949793
Only track inserts and deletes for tables being queried directly
...
# Conflicts:
# src/collection_notifications.cpp
# src/collection_notifications.hpp
2016-05-11 16:08:30 -07:00
Thomas Goyne
a86265f4dc
Move CollectionChangeBuilder to background_collection.hpp
2016-05-11 16:08:30 -07:00
Thomas Goyne
bc78c02e9d
Fix quadratic runtime of move_last_over() parsing
2016-05-11 16:08:30 -07:00
Thomas Goyne
2e80716629
Improve performance of move mapping when there are a lot of deletions
2016-05-11 16:08:30 -07:00
Thomas Goyne
ae9516dbb7
Improve performance for large numbers of deletions
2016-05-11 16:08:30 -07:00
Thomas Goyne
8623aa6c6b
Actually unregister List notifiers when the List is destroyed
2016-05-11 16:08:30 -07:00
Thomas Goyne
7a75e2bae2
Use a better data structure for IndexSet
...
Switch to a chunked vector-of-vectors which makes mid-insertions on large sets
much faster, and cache the begin/end/count for each chunk to make lookups much
more cache-friendly.
2016-05-11 16:08:30 -07:00
Thomas Goyne
f600487769
Speed up CollectionChangeBuilder::move_over()
2016-05-11 16:08:30 -07:00
Thomas Goyne
f051337cd3
Rename erase_and_unshift() to erase_or_unshift()
2016-05-11 16:08:30 -07:00
Thomas Goyne
dd336120b2
Fix compilation with GCC 4.9
2016-05-11 16:08:30 -07:00
Thomas Goyne
784c34e052
Add property.hpp to HEADERS
2016-05-11 16:08:30 -07:00
Thomas Goyne
bab5540cf6
Fix incorrect results when the second-to-last row is deleted
2016-05-11 16:08:30 -07:00
Thomas Goyne
20d9da973b
Make List and Results notifications more consistent
...
Deliver the initial results for both of them and include the changeset
in the initial delivery for both, rather than having them behave weirdly
differently.
2016-05-11 16:08:30 -07:00
Thomas Goyne
7a74a22558
Fix tracking of modifications after linkview moves
2016-05-11 16:08:30 -07:00
Thomas Goyne
a0b16305c9
Fix dangling pointers to a reallocated vector when there are multiple source versions for handover
2016-05-11 16:08:30 -07:00
Thomas Goyne
ef632804ef
Clean up stale moves for linkviews even without a merge
2016-05-11 16:08:30 -07:00
Thomas Goyne
feed7c3479
Update moves when there is another move to exactly the previous move target
2016-05-11 16:08:30 -07:00
Thomas Goyne
0a3158ce74
Fix marking deletions when chaining move_last_over()
2016-05-11 16:08:30 -07:00
Thomas Goyne
1289c4806c
Fix handling of move_last_over() on the second-to-last row
2016-05-11 16:08:30 -07:00
Thomas Goyne
edc0d1fc4a
Improve and expand the changeset calculation tests
2016-05-11 16:08:30 -07:00
Thomas Goyne
dc7ddfae84
Treat Results from LinkViews as if they were sorted for diff calculations
2016-05-11 16:08:30 -07:00
Thomas Goyne
71911ee221
Add support for wrapping a LinkView in a Results
2016-05-11 16:08:30 -07:00
Thomas Goyne
1b48c71932
Speed up transaction log parsing for queries
2016-05-11 16:08:30 -07:00
Thomas Goyne
5d5f504543
Greatly speed up sorted changeset calculations
2016-05-11 16:08:30 -07:00
Thomas Goyne
88a3b6ed00
Speed up the IndexSet combining operations
2016-05-11 16:08:30 -07:00
Thomas Goyne
fdeb80f970
Speed up IndexSet::count() a bit
2016-05-11 16:08:30 -07:00
Thomas Goyne
059f907a4a
Make sorted move calculations a bit less gross
2016-05-11 16:08:30 -07:00
Thomas Goyne
1a8a56d10a
Use binary search in IndexSet::find()
2016-05-11 16:08:30 -07:00
Thomas Goyne
f1f0327146
Speed up unsorted changeset calculations by eliminating most calls to count()
2016-05-11 16:08:30 -07:00
Thomas Goyne
c6def6b814
Don't parse the transaction logs on the background thread if no change info is needed
2016-05-11 16:08:30 -07:00
Thomas Goyne
9503a3fc03
Always send an empty changeset to the first call of a Results notification callback
2016-05-11 16:08:30 -07:00
Thomas Goyne
b5bd00005c
Skip collecting change information when it isn't needed
2016-05-11 16:08:30 -07:00
Thomas Goyne
e65ad4d413
Discard moves which are turned into no-ops when merging
2016-05-11 16:08:30 -07:00
Thomas Goyne
cfb9f0635c
Fix calculation of moves for unsorted queries
2016-05-11 16:08:30 -07:00
Thomas Goyne
d22c65f28a
Partially split out the code for calculating changesets from the struct for delivering them
2016-05-11 16:08:30 -07:00
Thomas Goyne
a4298dd92c
Remove an unused function
2016-05-11 16:08:30 -07:00
Thomas Goyne
b920f62ca5
Comment and clean up the Notifiers/BackgroundCollection
2016-05-11 16:08:30 -07:00
Thomas Goyne
4ec1090c05
Rename AsyncQuery to ResultsNotifier
2016-05-11 16:08:30 -07:00
Thomas Goyne
424f4e829f
Prioritize modified rows when calculating changes for sorted results
2016-05-11 16:08:30 -07:00
Thomas Goyne
a428f813d5
Skip calling callbacks if two commits cancel each other out when merged
2016-05-11 16:08:30 -07:00
Thomas Goyne
a16cd7d42d
Add async_query.hpp to the project
2016-05-11 16:08:30 -07:00
Thomas Goyne
9a0ec0eb28
Actually report deletions for table clears
2016-05-11 16:08:30 -07:00
Thomas Goyne
e25e4c2dcd
Rework handling of mixed move_last_over() and modifications to actually work
2016-05-11 16:08:30 -07:00
Thomas Goyne
d46f2c65ba
Refactor the transaction log parsers to eliminate some duplication
2016-05-11 16:08:30 -07:00
Thomas Goyne
f4aaa7c9de
Add fine-grained notifications for Results
2016-05-11 16:08:30 -07:00
Thomas Goyne
6609bcaed7
Add fine-grained notifications for List
2016-05-11 16:08:30 -07:00
Thomas Goyne
6380335fc3
Extract out the parts of AsyncQuery not directly related to query running
2016-05-11 16:08:30 -07:00
Nabil Hachicha
895c6a3056
Copying embedded Realm files using AssetManager from JNI
2016-05-11 19:56:59 +01:00
Thomas Goyne
deea1e8f5f
Merge pull request #67 from realm/tg/tvos-ech
...
Watch changes for tvOS without named pipes
2016-05-11 09:58:16 -07:00
Thomas Goyne
8d115ad42d
Merge pull request #68 from realm/tg/schema-validation-error
...
Split SchemaValidationException into SchemaValidationException and SchemaMismatchException
2016-05-11 09:58:06 -07:00
Ari Lazier
cf4fd74f52
pr fixes for build script
2016-05-10 14:01:27 -07:00
Thomas Goyne
c07fb9c963
Merge pull request #64 from realm/tg/leak
...
Fix the initial ref count for WeakRealmNotifier
2016-05-10 11:55:06 -07:00