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 (moved to Introduce the message classes for the delta protocol #276)
  • 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.

In preparation for this we extracted the PRs #274 #275 #276 and #277

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

Code Coverage

Overall Project 71.17% 🍏

There is no coverage information present for the Files changed

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.

@ftomassetti ftomassetti force-pushed the feature/delta-server branch 4 times, most recently from 5e49383 to a6d52fc Compare November 8, 2025 16:48
@ftomassetti ftomassetti mentioned this pull request Nov 9, 2025
…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.
…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.
…ent, enabling child removal across server, client, and model layers, with accompanying tests and validations.
…ies (`Enumeration`, `DataType`, `EnumerationLiteral`, etc.), refactor initialization logic for improved safety and consistency, and update related tests for validation.
…ference` DeltaCommand and `ReferenceAdded` DeltaEvent, update partition observers for index handling, and enhance `Enumeration` initialization with `id` constructor overloads.
…st`, reintroducing features with consistent `Property` constructors and modern `LionCoreBuiltins` string type assignment.
…ink` classes, refactor containments and properties initialization in `DeltaClientAndServerTest` for consistency and modern type usage.
…r tests for consistent property and containment initialization, and reintroduce regular references in `DeltaClientAndServerTest`.
… reintroduce test case comments in `DeltaClientAndServerTest`, and modernize enumeration literal handling with `id` constructor overloads.
…tion and reintroduce commented test cases in `DeltaClientAndServerTest` after updates for improved consistency and readability.
…Reference`, `Link`, `EnumerationLiteral`, `DataType`, etc.) and clean up related initialization logic for improved maintainability.
… `id` constructor overloads, streamline metamodel and test setup for improved consistency.
…lue` declaration in `HasFeatureValues` to simplify interface and improve clarity.
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