From 7b300429640822d5f01b0d069b64a15f27360b6c Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Wed, 31 Jan 2024 16:40:10 +0100 Subject: [PATCH] GLSP-1227: Ensure that model update is correct when using autolayout In the `submmitModelDirectly` method of the `ModelSubmissionHandler` the gmodel serialization was invoked before the layout engine was executed (in automatic layouting mode). As a consequence the model sent to the server reflected the unlayouted state. Fixes https://github.com/eclipse-glsp/glsp/issues/1227 --- .../src/common/features/model/model-submission-handler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/common/features/model/model-submission-handler.ts b/packages/server/src/common/features/model/model-submission-handler.ts index 4b97e94..ccd78f9 100644 --- a/packages/server/src/common/features/model/model-submission-handler.ts +++ b/packages/server/src/common/features/model/model-submission-handler.ts @@ -133,11 +133,12 @@ export class ModelSubmissionHandler { * @returns A list of actions to be processed in order to submit the model. */ async submitModelDirectly(reason?: DirtyStateChangeReason): Promise { - const root = this.serializeGModel(); - if (this.diagramConfiguration.layoutKind === ServerLayoutKind.AUTOMATIC && this.layoutEngine) { await this.layoutEngine.layout(); } + + const root = this.serializeGModel(); + const result: Action[] = []; result.push( this.requestModelAction