Skip to content

fix: default modification activated flag to true at creation only#190

Open
flomillot wants to merge 1 commit into
mainfrom
activated-default-on-creation
Open

fix: default modification activated flag to true at creation only#190
flomillot wants to merge 1 commit into
mainfrom
activated-default-on-creation

Conversation

@flomillot
Copy link
Copy Markdown
Contributor

The activated field of ModificationInfos defaulted to true (field initializer + @Builder.Default), so after JSON deserialization it was never null when omitted from a request.

As a consequence, the null guard if (metadata.getActivated() != null) in updateNetworkModificationMetadata (network-modification-server) was always satisfied, silently reactivating a deactivated modification when editing it without sending the field.

Change

  • activated now defaults to null in the DTO.
  • The true default must be applied at creation only (handled on the server side in the ModificationEntity(ModificationInfos) constructor).

This way, sending null on update leaves the activation status unchanged, while a creation without the field still produces an activated modification.

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 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Warning

Rate limit exceeded

@flomillot has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c3fab81a-e403-4569-a80c-7613d50bef64

📥 Commits

Reviewing files that changed from the base of the PR and between 286f4c9 and 70542c6.

📒 Files selected for processing (1)
  • src/main/java/org/gridsuite/modification/dto/ModificationInfos.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant