diff --git a/model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt b/model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt index 7b77c43e4c..fe96026668 100644 --- a/model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt +++ b/model-client/src/jvmMain/kotlin/org/modelix/model/client/ReplicatedRepository.kt @@ -235,7 +235,7 @@ actual open class ReplicatedRepository actual constructor( var initialVersion = if (versionHash.isNullOrEmpty()) null else loadFromHash(versionHash, store) val initialTree = MutableObject() if (initialVersion == null) { - initialTree.setValue(CLTree.builder(store).repositoryId(branchReference.repositoryId).build()) + initialTree.setValue(CLTree.builder(store).useRoleIds(false).repositoryId(branchReference.repositoryId).build()) initialVersion = createVersion(initialTree.value, arrayOf(), null) client.asyncStore.put(branchReference.getKey(), initialVersion.getContentHash()) } else { diff --git a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt index ef88b5d93d..d2b20c86b4 100644 --- a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt +++ b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt @@ -12,7 +12,6 @@ import org.modelix.model.api.ITree import org.modelix.model.api.async.getAncestors import org.modelix.model.api.async.getDescendants import org.modelix.model.async.AsyncAsSynchronousTree -import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore import org.modelix.model.async.AsyncTree import org.modelix.model.async.IAsyncObjectStore import org.modelix.model.persistent.CPHamtInternal @@ -58,7 +57,7 @@ class CLTree(val data: CPTree, val asyncStore: IAsyncObjectStore) : ITree by Asy store, ) - val store: IDeserializingKeyValueStore = AsyncStoreAsLegacyDeserializingStore(asyncStore) + val store: IDeserializingKeyValueStore = asyncStore.getLegacyObjectStore() override fun getId(): String = data.id diff --git a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLVersion.kt b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLVersion.kt index 6d20d4b63f..2e246fa91b 100644 --- a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLVersion.kt +++ b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/CLVersion.kt @@ -22,7 +22,6 @@ import org.modelix.model.api.PNodeReference import org.modelix.model.api.TreePointer import org.modelix.model.api.async.getDescendants import org.modelix.model.async.AsyncAsSynchronousTree -import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore import org.modelix.model.async.AsyncTree import org.modelix.model.async.BulkQueryAsAsyncStore import org.modelix.model.async.IAsyncObjectStore @@ -277,7 +276,7 @@ class CLVersion : IVersion { } fun tryLoadFromHash(hash: String, store: IAsyncObjectStore): Maybe { - return KVEntryReference(hash, CPVersion.DESERIALIZER).getValue(store).notNull().map { CLVersion(it, AsyncStoreAsLegacyDeserializingStore(store)) } + return KVEntryReference(hash, CPVersion.DESERIALIZER).getValue(store).notNull().map { CLVersion(it, store) } } } diff --git a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/IKVEntryReference.kt b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/IKVEntryReference.kt index cb46c5cab7..9fe9f9e95b 100644 --- a/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/IKVEntryReference.kt +++ b/model-datastructure/src/commonMain/kotlin/org/modelix/model/lazy/IKVEntryReference.kt @@ -1,7 +1,6 @@ package org.modelix.model.lazy import com.badoo.reaktive.single.Single -import org.modelix.model.async.AsyncStoreAsLegacyDeserializingStore import org.modelix.model.async.IAsyncObjectStore import org.modelix.model.persistent.IKVValue @@ -13,5 +12,5 @@ interface IKVEntryReference { fun getUnwrittenValue(): E fun getDeserializer(): (String) -> E fun write(store: IDeserializingKeyValueStore) - fun write(store: IAsyncObjectStore) = write(AsyncStoreAsLegacyDeserializingStore(store)) + fun write(store: IAsyncObjectStore) = write(store.getLegacyObjectStore()) }