Allow setting shouldCompactOnLaunch on synchronized Realms

This commit is contained in:
Thomas Goyne 2018-06-18 10:02:01 -07:00 committed by Thomas Goyne
parent 89bb4ce0b3
commit 2189feb640
2 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,25 @@
X.Y.Z Release notes
=============================================================
### Compatibility
* Sync protocol: 24
* Server-side history format: 4
* File format: 7
* Realm Object Server: 3.0.0 or later
### Breaking changes
* None.
### Enhancements
* Added support for compacting synchronized Realms and allowed setting the
`shouldCompactOnLaunch` config property for them.
### Bug fixes
* None.
### Internals
* None.
2.8.5 Release notes (2018-6-18)
=============================================================
### Compatibility

View File

@ -516,9 +516,6 @@ void RealmClass<T>::constructor(ContextType ctx, ObjectType this_object, size_t
if (config.schema_mode == SchemaMode::Immutable) {
throw std::invalid_argument("Cannot set 'shouldCompactOnLaunch' when 'readOnly' is set.");
}
if (config.sync_config) {
throw std::invalid_argument("Cannot set 'shouldCompactOnLaunch' when 'sync' is set.");
}
FunctionType should_compact_on_launch_function = Value::validated_to_function(ctx, compact_value, "shouldCompactOnLaunch");
config.should_compact_on_launch_function = [=](uint64_t total_bytes, uint64_t unused_bytes) {