Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network modification connect and disconnect #2831

Merged
merged 24 commits into from
Jan 16, 2024
Merged

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Dec 12, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

Fixes #2805

What kind of change does this PR introduce?

feature

What is the current behavior?

When connecting/disconnecting a terminal, you get a confirmation boolean after the modification is done, which means that if you try to disconnect a connectable with 2 terminals, you will disconnect the first then the second. The problem is that if the 2nd disconnection fails, the first is still done so you have a connectable half-way disconnected

What is the new behavior (if this is a feature change)?
By using the connect/disconnect methods from the connectable class, you will connect/disconnect the different terminals if and only if all the terminals can be connected/disconnected.
If some terminals were already connected/disconnected, it will still work and the other terminals will be connected/disconnected.
If all the terminals were already connected/disconnected, it will fail and return false

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@rolnico rolnico requested a review from flo-dup December 12, 2023 14:41
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Comment on lines +310 to +313
// Exit if the connectable is already fully disconnected
if (isAlreadyDisconnected) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true? I would expect the connectable to be non-disconnectable if disconnect returns false. Oh but it's the same for the Terminal... and we didn't put any javadoc to tell what it should return 🙁
If we return true, can't we avoid this? I think the code after should be proof against that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some discussion, this breaking change should not be done here.
But could we put in the javadoc that returning false means no changes?

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Copy link

@flo-dup flo-dup merged commit 4c577f8 into main Jan 16, 2024
6 checks passed
@flo-dup flo-dup deleted the nro/network_modif_connect branch January 16, 2024 15:27
@flo-dup flo-dup mentioned this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network modification for connecting/disconnecting a connectable
3 participants