Skip to content

Conversation

@ftomassetti
Copy link
Contributor

@ftomassetti ftomassetti commented Oct 24, 2025

With this PR we setup the infrastructure to support the delta protocol.

  • We create the basic classes for commands and events
  • We define the main interfaces
  • We add the possibility to monitor nodes for changes, considering only property changes for now
  • We add support in the InMemoryServer to execute commands for property changes

This is intended to collect early feedback before implementing support for other commands and events.

Only then we will implement the DeltaChannel that actually exchanges messages through WebSockets.

…ty`, `DeleteProperty`, etc.), queries (`SignOn`, `SubscribeToPartitionContents`, etc.), events (`PropertyAdded`), and supporting classes (`DeltaChannel`, `DeltaProtocolVersion`).
…place references, annotations, and children, covering various parent and containment scenarios with documentation updates and null checks.
…cross and within references, refactor existing commands to use `final` fields for immutability.
…, and move operations across references, with immutability improvements and comprehensive documentation updates.
…n, and general events, enhancing immutability and adding comprehensive documentation.
…` and `Reconnect` classes, and improve structure for queries and subscriptions.
… for properties, including tests, new utility methods in `ClassifierInstanceUtils`, and `InMemoryDeltaChannel` implementation.
…nt` and refactor tests for client-server synchronization.
…h new `DeltaCommandReceiver` interface, including server-side partition and property synchronization enhancements.
…nd consistency; optimize formatting and remove unused imports.
…taCommandResponse` with acceptance and rejection support.
…InMemoryServer` for simplification and cleanup.
@github-actions
Copy link

github-actions bot commented Oct 24, 2025

Code Coverage

Overall Project 66.93% -0.87% 🍏
Files changed 10.83%

File Coverage
Concept.java 98.35% 🍏
SerializedClassifierInstance.java 91.77% -8.23%
ClassifierInstanceUtils.java 82.26% -7.29%
M3Node.java 74.19% -11.09%
ModelComparator.java 46.89% -3.76%
HasFeatureValues.java 0%

import java.util.function.Function;
import org.jetbrains.annotations.Nullable;

public class InMemoryDeltaChannel implements DeltaChannel {
Copy link
Contributor

Choose a reason for hiding this comment

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

When implementing C#, I first thought it would be very nice for debugging to have both the client and the server in the same process. It turned out to be very confusing, as we have several instances of the same node (with the same id) to handle.
To me, it now feels more convenient to have them in separate processes.

YMMV, just sharing some pain (-:

"Node with id " + changeProperty.node + " not found");
}
SerializedClassifierInstance node = retrieved.get(0);
String oldValue = node.getPropertyValue(((ChangeProperty) command).property);
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to separate the protocol handling from applying the deltas to a local model, and this turned out to be helpful: In our project, we're actually not using the repository, but recording all deltas on one side, sending them to the other side, and apply them there. We can reuse all the logic written for repository.

…ion command classes for better validation and robustness.
…ing immutability and consistent field annotations.
…o `@NotNull` and introducing additional null checks for `parent` and `reference` fields.
…g convention and add corresponding `Response` classes with null safety improvements and validations.
…nt event classes for consistency and introducing abstract enforcement for standardized behavior.
…g, removing classes and methods related to command responses and adding standardized error codes for improved error propagation and diagnostics.
…cross server, client, and model layers, introducing indexed child insertion functionality and associated validations.
…`, introduce `DeltaQueryReceiver` and query response flow, and enhance `DeltaClient` and `InMemoryDeltaChannel` for synchronized command and query handling.
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.

3 participants