From 70542c656a0be5ab539f779044cd42c4c45df4c8 Mon Sep 17 00:00:00 2001 From: Florent MILLOT <75525996+flomillot@users.noreply.github.com> Date: Fri, 22 May 2026 11:55:40 +0200 Subject: [PATCH] fix: default modification activated flag to true at creation only The activated field defaulted to true in the DTO, so after deserialization it was never null when omitted from a request. This made the null guard in updateNetworkModificationMetadata always pass, silently reactivating a deactivated modification on edit. The field now defaults to null; the true default is applied at creation only, which preserves the activated status when the field is not provided on update. Co-Authored-By: Claude Opus 4.7 Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com> --- .../org/gridsuite/modification/dto/ModificationInfos.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/dto/ModificationInfos.java b/src/main/java/org/gridsuite/modification/dto/ModificationInfos.java index 840a4aa6..ac8b09c8 100644 --- a/src/main/java/org/gridsuite/modification/dto/ModificationInfos.java +++ b/src/main/java/org/gridsuite/modification/dto/ModificationInfos.java @@ -115,9 +115,8 @@ public class ModificationInfos { @Schema(description = "Message values") private String messageValues; - @Schema(description = "Modification activated") - @Builder.Default - private Boolean activated = true; + @Schema(description = "Modification activated (defaults to true at creation when not provided)") + private Boolean activated; @Schema(description = "User description") private String description;