Skip to content

Commit

Permalink
Fix issue with Dependencies order which could cause crashes on migrat…
Browse files Browse the repository at this point in the history
…ion check.
  • Loading branch information
jurmous committed Oct 24, 2024
1 parent 5deaf02 commit a7e43c3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ class EmbeddedObjectDefinition<DO : Any, DM : IsTypedObjectDataModel<DO, *, CXI,

override fun getAllDependencies(dependencySet: MutableList<MarykPrimitive>) {
if (!dependencySet.contains(dataModel as MarykPrimitive)) {
dependencySet.add(dataModel as MarykPrimitive)
dataModel.getAllDependencies(dependencySet)
dependencySet.add(dataModel as MarykPrimitive)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class EmbeddedValuesDefinition<DM : IsValuesDataModel>(

override fun getAllDependencies(dependencySet: MutableList<MarykPrimitive>) {
if (!dependencySet.contains(dataModel as MarykPrimitive)) {
dependencySet.add(dataModel as MarykPrimitive)
dataModel.getAllDependencies(dependencySet)
dependencySet.add(dataModel as MarykPrimitive)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ suspend fun HbaseDataStore.storeModelDefinition(

val dependencies = mutableListOf<MarykPrimitive>()
dataModel.getAllDependencies(dependencies)
// Needs to be in reverse order to do sub dependencies first and then the higher up dependencies
dependencies.reverse()

if (dependencies.isNotEmpty()) {
val dependentCache = WriteCache()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ fun storeModelDefinition(

val dependencies = mutableListOf<MarykPrimitive>()
dataModel.getAllDependencies(dependencies)
// Needs to be in reverse order to do sub dependencies first and then the higher up dependencies
dependencies.reverse()

if (dependencies.isNotEmpty()) {
val dependentCache = WriteCache()
Expand Down

0 comments on commit a7e43c3

Please sign in to comment.