Skip to content

Commit

Permalink
[4204] Prevent the changeDescriptionSink from crashing because of the…
Browse files Browse the repository at this point in the history
… related representation refresh

Bug: #4204
Signed-off-by: Denis Nikiforov <[email protected]>
  • Loading branch information
AresEkb committed Jan 7, 2025
1 parent 3f2ad65 commit 9aaf607
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This may have some consequences for downstream applications which are embedding
=== Bug fixes

- https://github.com/eclipse-sirius/sirius-web/issues/4282[#4282] [diagram] Fixed a warning on the frontend about non-unique GraphQL fragment name
- https://github.com/eclipse-sirius/sirius-web/issues/4204[#4204] [core] Prevent the changeDescriptionSink from crashing because of the related representation refresh

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ public Optional<Boolean> 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);
}
}

0 comments on commit 9aaf607

Please sign in to comment.