Skip to content

Conversation

@martin-fleck-at
Copy link
Contributor

What it does

  • Filter empty change bounds and change routing points operations
  • Filter empty compound commands
  • Ensure we only submit a new model if actual changes were applied

Relates to eclipse-glsp/glsp#1477

How to test

  • Move an element without actually snapping to a new position
  • Debug server state or observer undo/redo stack is correctly as there are no operations on the command stack

Follow-ups

Changelog

  • This PR should be mentioned in the changelog IF the submission change is accepted as well
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)
  • If the submission change is accepted as well, this may change the behavior in a way that the GModel is not re-generated after an empty operation. Adopters may have relied on that so this would constitute a breaking change as the previous behavior is also valid and may not strictly be classified as a bug.

- Filter empty change bounds and change routing points operations
- Filter empty compound commands
- Ensure we only submit a new model if actual changes were applied

Relates to  eclipse-glsp/glsp#1477
return this.submitModel();
}
return this.modelSubmissionHandler.submitModel('operation');
return [];
Copy link
Contributor Author

@martin-fleck-at martin-fleck-at Feb 26, 2025

Choose a reason for hiding this comment

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

This may change the behavior in a way that the GModel is not re-generated after an empty operation. Adopters may have relied on that so this would constitute a breaking change as the previous behavior is also valid and may not strictly be classified as a bug. So I am happy to discuss whether this should be changed or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this is more of a bugfix to ensure that the operation handler works as expected.
Nevertheless your are right in certain edge cases adopters may have relied on a model update
(I can`t think of any particular usecase where a effectivly no-op update would be required but who knows).
Maybe we should at least refactor this in overrideable method or property to configure whether update on empty commands should be enabled?
We disable it by default but atleast it gives adopters an easy entry point to change the behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree now that we can consider this more of a bugfix since the Java server was behaving like this all along. So I would almost argue that we do not need an additional flag. The method as-is is already very short and could be overwritten, don't you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏼 Fine with me.

Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Changes look good to me.
I guess we need a follow-up for the Java server as well?

@martin-fleck-at
Copy link
Contributor Author

Changes look good to me. I guess we need a follow-up for the Java server as well?

Follow-up: eclipse-glsp/glsp-server#253

@tortmayr tortmayr merged commit 86e89a1 into main Feb 26, 2025
6 checks passed
@tortmayr tortmayr deleted the issues/1477 branch February 26, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants