Skip to content

Commit 5ed06af

Browse files
authored
Merge pull request #1274 from modelix/fix/for-legacy-sync-plugin
Fixes for the legacy-sync-plugin
2 parents 545c046 + 3052d4b commit 5ed06af

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ actual open class ReplicatedRepository actual constructor(
235235
var initialVersion = if (versionHash.isNullOrEmpty()) null else loadFromHash(versionHash, store)
236236
val initialTree = MutableObject<CLTree>()
237237
if (initialVersion == null) {
238-
initialTree.setValue(CLTree.builder(store).repositoryId(branchReference.repositoryId).build())
238+
initialTree.setValue(CLTree.builder(store).useRoleIds(false).repositoryId(branchReference.repositoryId).build())
239239
initialVersion = createVersion(initialTree.value, arrayOf(), null)
240240
client.asyncStore.put(branchReference.getKey(), initialVersion.getContentHash())
241241
} else {

model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import org.modelix.model.api.ITree
1212
import org.modelix.model.api.async.getAncestors
1313
import org.modelix.model.api.async.getDescendants
1414
import org.modelix.model.async.AsyncAsSynchronousTree
15-
import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore
1615
import org.modelix.model.async.AsyncTree
1716
import org.modelix.model.async.IAsyncObjectStore
1817
import org.modelix.model.persistent.CPHamtInternal
@@ -58,7 +57,7 @@ class CLTree(val data: CPTree, val asyncStore: IAsyncObjectStore) : ITree by Asy
5857
store,
5958
)
6059

61-
val store: IDeserializingKeyValueStore = AsyncStoreAsLegacyDeserializingStore(asyncStore)
60+
val store: IDeserializingKeyValueStore = asyncStore.getLegacyObjectStore()
6261

6362
override fun getId(): String = data.id
6463

model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLVersion.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.modelix.model.api.PNodeReference
2222
import org.modelix.model.api.TreePointer
2323
import org.modelix.model.api.async.getDescendants
2424
import org.modelix.model.async.AsyncAsSynchronousTree
25-
import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore
2625
import org.modelix.model.async.AsyncTree
2726
import org.modelix.model.async.BulkQueryAsAsyncStore
2827
import org.modelix.model.async.IAsyncObjectStore
@@ -277,7 +276,7 @@ class CLVersion : IVersion {
277276
}
278277

279278
fun tryLoadFromHash(hash: String, store: IAsyncObjectStore): Maybe<CLVersion> {
280-
return KVEntryReference(hash, CPVersion.DESERIALIZER).getValue(store).notNull().map { CLVersion(it, AsyncStoreAsLegacyDeserializingStore(store)) }
279+
return KVEntryReference(hash, CPVersion.DESERIALIZER).getValue(store).notNull().map { CLVersion(it, store) }
281280
}
282281
}
283282

model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/IKVEntryReference.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.modelix.model.lazy
22

33
import com.badoo.reaktive.single.Single
4-
import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore
54
import org.modelix.model.async.IAsyncObjectStore
65
import org.modelix.model.persistent.IKVValue
76

@@ -13,5 +12,5 @@ interface IKVEntryReference<out E : IKVValue> {
1312
fun getUnwrittenValue(): E
1413
fun getDeserializer(): (String) -> E
1514
fun write(store: IDeserializingKeyValueStore)
16-
fun write(store: IAsyncObjectStore) = write(AsyncStoreAsLegacyDeserializingStore(store))
15+
fun write(store: IAsyncObjectStore) = write(store.getLegacyObjectStore())
1716
}

0 commit comments

Comments
 (0)