Skip to content

Conversation

@lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Feb 9, 2026

The enhancement consists in just getting the UID of the elements to be removed rather than building a full object.

The enhancement consists in just getting the UID of the elements to be removed rather than building a full object.

Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo lolodomo requested a review from a team as a code owner February 9, 2026 22:19
@lolodomo
Copy link
Contributor Author

lolodomo commented Feb 9, 2026

@Nadahar for information as it is in response to something you reported.

@Nadahar
Copy link
Contributor

Nadahar commented Feb 10, 2026

@lolodomo I tried to see if I could review it, but I find the streams stuff completely unreadable and can't really see what has changed (except for writing the streams slightly different). Sorry, but my review doesn't matter much anyway 😉

@mherwege
Copy link
Contributor

What about also delaying the mapping in the addedModel and updatedModel until listeners have to be notified (which would require the object)? That would avoid the mapping all together if the model is isolated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Optimizes YAML model removal handling by avoiding construction of full domain objects when removing elements, relying instead on DTO identifiers (UID/name) to find and remove existing elements from in-memory collections.

Changes:

  • Update removedModel in Thing provider to remove Things by DTO uid rather than mapping full Thing objects.
  • Update removedModel in Semantic Tag provider to remove tags by DTO uid rather than mapping full SemanticTag objects.
  • Update removedModel in Item provider to remove items by DTO name rather than mapping full Item objects.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/things/YamlThingProvider.java Removes Things using DTO uid directly rather than building Things for comparison.
bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/semantics/YamlSemanticTagProvider.java Removes SemanticTags using DTO uid directly rather than building SemanticTag instances.
bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/items/YamlItemProvider.java Removes Items using DTO name directly rather than building Items for removal lookup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lolodomo lolodomo mentioned this pull request Feb 11, 2026
Nadahar pushed a commit to Nadahar/openhab-core that referenced this pull request Feb 11, 2026
Signed-off-by: Laurent Garnier <[email protected]>
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