Skip to content

Commit

Permalink
Reverse TreeChanges when Deleting in Tree (#172)
Browse files Browse the repository at this point in the history
* Reverse TreeChanges when Deleting in Tree

* update version to 0.4.16

* clean up the code

* update library versions
  • Loading branch information
7hong13 authored Apr 18, 2024
1 parent 1760113 commit 92039e2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarni
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
GROUP=dev.yorkie
VERSION_NAME=0.4.15
VERSION_NAME=0.4.16
POM_DESCRIPTION=Document store for building collaborative editing applications.
POM_INCEPTION_YEAR=2022
POM_URL=https://github.com/yorkie-team/yorkie-android-sdk
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ agp = "8.3.2"
connectKotlin = "0.6.0"
okhttp = "4.12.0"
coroutines = "1.8.0"
androidxActivity = "1.8.2"
androidxActivity = "1.9.0"
androidxLifecycle = "2.7.0"
androidxBenchmark = "1.2.3"
androidxComposeCompiler = "1.5.11"
Expand All @@ -24,7 +24,7 @@ kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotli

apache-commons-collections = { group = "org.apache.commons", name = "commons-collections4", version = "4.4" }

androidx-core = { group = "androidx.core", name = "core-ktx", version = "1.12.0" }
androidx-core = { group = "androidx.core", name = "core-ktx", version = "1.13.0" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.6.1" }
androidx-activity = { group = "androidx.activity", name = "activity-ktx", version.ref = "androidxActivity" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" }
Expand All @@ -33,7 +33,7 @@ androidx-lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle
androidx-lifecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "androidxLifecycle" }
androidx-benchmark = { group = "androidx.benchmark", name = "benchmark-junit4", version.ref = "androidxBenchmark" }

androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version = "2024.04.00" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version = "2024.04.01" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
Expand Down
2 changes: 1 addition & 1 deletion yorkie/src/androidTest/kotlin/dev/yorkie/core/GCTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ class GCTest {
}.await()

assertEquals(3, document.garbageLength)
assertEquals(3, document.garbageLengthFromClone)
assertEquals(3, document.clone?.root?.getGarbageLength() ?: 0)

document.close()
client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,8 @@ class JsonTreeTest {
assertTreeEditOpInfosEquals(
listOf(
SimpleTreeEditOpInfo(2, 2, text { "c" }),
SimpleTreeEditOpInfo(1, 2),
SimpleTreeEditOpInfo(3, 4),
SimpleTreeEditOpInfo(1, 2),
),
ops2,
)
Expand Down
3 changes: 0 additions & 3 deletions yorkie/src/main/kotlin/dev/yorkie/document/Document.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ public class Document(
public val garbageLength: Int
get() = root.getGarbageLength()

internal val garbageLengthFromClone: Int
get() = clone?.root?.getGarbageLength() ?: 0

private val presenceEventQueue = mutableListOf<Event.PresenceChange>()
internal val pendingPresenceEvents = mutableListOf<Event.PresenceChange>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ internal class CrdtTree(
}
}
}
return changes
return changes.reversed()
}

private fun findRightToken(treeToken: CrdtTreeToken): CrdtTreeToken {
Expand Down

0 comments on commit 92039e2

Please sign in to comment.