From 39341983024b02c23023b7053ab00670196f10cd Mon Sep 17 00:00:00 2001 From: Denis Nikiforov Date: Sat, 16 Nov 2024 10:35:25 +0300 Subject: [PATCH] [4204] Prevent the changeDescriptionSink from crashing because of the related representation refresh Bug: https://github.com/eclipse-sirius/sirius-web/issues/4204 Signed-off-by: Denis Nikiforov --- CHANGELOG.adoc | 1 + .../editingcontext/EditingContextEventProcessor.java | 12 ++++++------ .../sirius/components/interpreter/Result.java | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index c8e9889bbc..558207b0f5 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -65,6 +65,7 @@ This was first fixed in 2022.3.0 but broken in 2024.3.0; it is now fixed again. + Contribute the Ellipse node + Contribute the Selection Dialog - https://github.com/eclipse-sirius/sirius-web/issues/4305[#4305] [table] Allow the deactivation of table features that are not used in some contexts +- https://github.com/eclipse-sirius/sirius-web/issues/4204[#4204] [core] Prevent the changeDescriptionSink from crashing because of the related representation refresh === New Features diff --git a/packages/core/backend/sirius-components-collaborative/src/main/java/org/eclipse/sirius/components/collaborative/editingcontext/EditingContextEventProcessor.java b/packages/core/backend/sirius-components-collaborative/src/main/java/org/eclipse/sirius/components/collaborative/editingcontext/EditingContextEventProcessor.java index b9eed4fd78..2537ca5c8a 100644 --- a/packages/core/backend/sirius-components-collaborative/src/main/java/org/eclipse/sirius/components/collaborative/editingcontext/EditingContextEventProcessor.java +++ b/packages/core/backend/sirius-components-collaborative/src/main/java/org/eclipse/sirius/components/collaborative/editingcontext/EditingContextEventProcessor.java @@ -157,18 +157,18 @@ private Disposable setupChangeDescriptionSinkConsumer() { var refreshRepresentationSample = Timer.start(this.meterRegistry); - RepresentationEventProcessorEntry representationEventProcessorEntry = this.representationEventProcessors.get(changeDescription.getSourceId()); - if (representationEventProcessorEntry != null) { - try { + try { + RepresentationEventProcessorEntry representationEventProcessorEntry = this.representationEventProcessors.get(changeDescription.getSourceId()); + if (representationEventProcessorEntry != null) { IRepresentationEventProcessor representationEventProcessor = representationEventProcessorEntry.getRepresentationEventProcessor(); representationEventProcessor.refresh(changeDescription); IRepresentation representation = representationEventProcessor.getRepresentation(); this.applicationEventPublisher.publishEvent(new RepresentationRefreshedEvent(this.editingContext.getId(), representation)); - } catch (Exception exception) { - this.logger.warn(exception.getMessage(), exception); } + this.refreshOtherRepresentations(changeDescription); + } catch (Exception exception) { + this.logger.warn(exception.getMessage(), exception); } - this.refreshOtherRepresentations(changeDescription); var timer = this.meterRegistry.timer(Monitoring.TIMER_REFRESH_REPRESENTATION, "changeDescription", changeDescription.getSourceId()); refreshRepresentationSample.stop(timer); diff --git a/packages/emf/backend/sirius-components-interpreter/src/main/java/org/eclipse/sirius/components/interpreter/Result.java b/packages/emf/backend/sirius-components-interpreter/src/main/java/org/eclipse/sirius/components/interpreter/Result.java index b452eeac51..21a9d69b11 100644 --- a/packages/emf/backend/sirius-components-interpreter/src/main/java/org/eclipse/sirius/components/interpreter/Result.java +++ b/packages/emf/backend/sirius-components-interpreter/src/main/java/org/eclipse/sirius/components/interpreter/Result.java @@ -147,6 +147,6 @@ public Optional asBoolean() { @Override public String toString() { - return MessageFormat.format("Result { status: {0}, rawValue: {1}}", this.status, this.rawValue); + return MessageFormat.format("Result '{' status: {0}, rawValue: {1} '}'", this.status, this.rawValue); } }