Skip to content

Commit

Permalink
Update to Core 14.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech committed Feb 28, 2024
1 parent 17e4015 commit 5fc28ec
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 1.14.0-SNAPSHOT (YYYY-MM-DD)

This release will bump the Realm file format from version 23 to 24. Opening a file with an older format will automatically upgrade it from fileformat v10. If you want to upgrade from an earlier file format version you will have to use Realm Kotlin v1.13.1 or earlier. Downgrading to a previous file format is not possible.

### Breaking Changes
* None.

Expand Down Expand Up @@ -31,9 +33,9 @@
### Internal
* Update to Ktor 2.3.4.
* Updated to CMake 3.27.7
* Updated to Realm Core 13.26.0, commit 5533505d18fda93a7a971d58a191db5005583c92.
* Updated to Realm Core 14.0.1 commit b1d32d3d20fcb80c747aad6b37b4a9d9179e0730.
* Adding Sync tests via Github Action.
* Updated to Swig 4.2.0. (Issue [GitHub #1632](https://github.com/realm/realm-kotlin/issues/1632)[JIRA RKOTLIN-1001](https://jira.mongodb.org/browse/RKOTLIN-1001))
* Updated to Swig 4.2.0. (Issue [GitHub #1632](https://github.com/realm/realm-kotlin/issues/1632) [JIRA RKOTLIN-1001](https://jira.mongodb.org/browse/RKOTLIN-1001))


## 1.13.1-SNAPSHOT (YYYY-MM-DD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,15 +942,20 @@ actual object RealmInterop {
val deletionCount = LongArray(1)
val modificationCount = LongArray(1)
val movesCount = LongArray(1)
// Not exposed in SDK yet, but could be used to provide optimized notifications when
// collections are cleared.
// https://github.com/realm/realm-kotlin/issues/1498
val collectionWasCleared = BooleanArray(1)
val collectionWasDeleted = BooleanArray(1)

realmc.realm_collection_changes_get_num_changes(
change.cptr(),
deletionCount,
insertionCount,
modificationCount,
movesCount,
collectionWasCleared
collectionWasCleared,
collectionWasDeleted,
)

val insertionIndices: LongArray = initIndicesArray(insertionCount)
Expand Down Expand Up @@ -1042,24 +1047,31 @@ actual object RealmInterop {
val deletions = longArrayOf(0)
val insertions = longArrayOf(0)
val modifications = longArrayOf(0)
val collectionWasDeleted = BooleanArray(1)
realmc.realm_dictionary_get_changes(
change.cptr(),
deletions,
insertions,
modifications
modifications,
collectionWasDeleted
)

val deletionStructs = realmc.new_valueArray(deletions[0].toInt())
val insertionStructs = realmc.new_valueArray(insertions[0].toInt())
val modificationStructs = realmc.new_valueArray(modifications[0].toInt())
// Not exposed in SDK yet, but could be used to provide optimized notifications when
// collections are cleared.
// https://github.com/realm/realm-kotlin/issues/1498
val collectionWasCleared = booleanArrayOf(false)
realmc.realm_dictionary_get_changed_keys(
change.cptr(),
deletionStructs,
deletions,
insertionStructs,
insertions,
modificationStructs,
modifications
modifications,
collectionWasCleared,
)

// TODO optimize - integrate within mem allocator?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1864,14 +1864,16 @@ actual object RealmInterop {
val modificationCount = allocArray<ULongVar>(1)
val movesCount = allocArray<ULongVar>(1)
val collectionWasErased = alloc<BooleanVar>()
val collectionWasDeleted = alloc<BooleanVar>()

realm_wrapper.realm_collection_changes_get_num_changes(
change.cptr(),
deletionCount,
insertionCount,
modificationCount,
movesCount,
collectionWasErased.ptr
collectionWasErased.ptr,
collectionWasDeleted.ptr,
)

val deletionIndices = initArray<ULongVar>(deletionCount)
Expand Down Expand Up @@ -1953,12 +1955,15 @@ actual object RealmInterop {
val deletions = allocArray<ULongVar>(1)
val insertions = allocArray<ULongVar>(1)
val modifications = allocArray<ULongVar>(1)
val collectionWasCleared = alloc<BooleanVar>()
val collectionWasDeleted = alloc<BooleanVar>()

realm_wrapper.realm_dictionary_get_changes(
change.cptr(),
deletions,
insertions,
modifications
modifications,
collectionWasDeleted.ptr
)
val deletionStructs = allocArray<realm_value_t>(deletions[0].toInt())
val insertionStructs = allocArray<realm_value_t>(insertions[0].toInt())
Expand All @@ -1971,7 +1976,8 @@ actual object RealmInterop {
insertionStructs,
insertions,
modificationStructs,
modifications
modifications,
collectionWasCleared.ptr
)

val deletedKeys = (0 until deletions[0].toInt()).map {
Expand Down
2 changes: 1 addition & 1 deletion packages/external/core
Submodule core updated 455 files
4 changes: 3 additions & 1 deletion packages/jni-swig-stub/realm.i
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ import static io.realm.kotlin.internal.interop.realm_errno_e.*;
// bool output parameter
%apply bool* OUTPUT { bool* out_found, bool* did_create, bool* did_delete_realm, bool* out_inserted,
bool* erased, bool* out_erased, bool* did_refresh, bool* did_run,
bool* found, bool* out_collection_was_cleared, bool* did_compact };
bool* found, bool* out_collection_was_cleared, bool* did_compact,
bool* collection_was_cleared, bool* out_collection_was_deleted,
bool* out_was_deleted};

// uint64_t output parameter for realm_get_num_versions
%apply int64_t* OUTPUT { uint64_t* out_versions_count };
Expand Down

0 comments on commit 5fc28ec

Please sign in to comment.