Skip to content

Commit 1d4de91

Browse files
committed
fix merge conflict
Signed-off-by: AAJELLAL <[email protected]>
1 parent 6d73e3d commit 1d4de91

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/gridsuite/study/server/service/NetworkModificationTreeService.java

+11
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,20 @@ public void unbuild(UUID nodeUuid, UUID rootNetworkUuid, InvalidateNodeInfos inv
904904
}
905905
);
906906

907+
handleElasticsearchNodeModifications(nodeUuid, rootNetworkUuid, invalidateNodeInfos);
907908
notificationService.emitNodeBuildStatusUpdated(studyId, changedNodes.stream().distinct().toList(), rootNetworkUuid);
908909
}
909910

911+
private void handleElasticsearchNodeModifications(UUID nodeUuid, UUID rootNetworkUuid, InvalidateNodeInfos invalidateNodeInfos) {
912+
// when manually invalidating a single node, if this node does not have any built children
913+
// we need to invalidate indexed modifications up to it's last built parent, not included
914+
if (!hasAnyBuiltChildren(getNodeEntity(nodeUuid), rootNetworkUuid)) {
915+
// when invalidating nodes, we need to get last built parent to invalidate all its children modifications in elasticsearch
916+
NodeEntity closestNodeWithParentHavingBuiltDescendent = getSubTreeToInvalidateIndexedModifications(nodeUuid, rootNetworkUuid);
917+
fillIndexedModificationsInfosToInvalidate(closestNodeWithParentHavingBuiltDescendent.getIdNode(), true, invalidateNodeInfos);
918+
}
919+
}
920+
910921
private void invalidateChildrenBuildStatus(UUID nodeUuid, UUID rootNetworkUuid, List<UUID> changedNodes, InvalidateNodeInfos invalidateNodeInfos,
911922
boolean deleteVoltageInitResults) {
912923
nodesRepository.findAllByParentNodeIdNode(nodeUuid)

0 commit comments

Comments
 (0)