Skip to content

GLSP-1727: Keep applying computed bounds when an entry cannot be applied - #295

Merged
martin-fleck-at merged 2 commits into
masterfrom
issues/1727-resilient-computed-bounds
Aug 26, 2026
Merged

GLSP-1727: Keep applying computed bounds when an entry cannot be applied#295
martin-fleck-at merged 2 commits into
masterfrom
issues/1727-resilient-computed-bounds

Conversation

@martin-fleck-at

Copy link
Copy Markdown
Contributor

What it does

A single unresolvable element in a ComputedBoundsAction aborted the whole batch: the client had already measured every element, but one stale id threw and the server dropped the remaining bounds, alignments and routes along with the model update the client was waiting for. Mirrors the same fix in glsp-server-node.

  • resolve elements through the index Optional instead of getOrThrow, so an unknown id yields an empty result
  • report a route with fewer than two points as not applicable rather than as an error, a client may have nothing to report for an unmeasured edge yet
  • log a skipped entry, routes at debug level because an edge the client has not finished routing yet is expected
  • split the apply step into applyElementBounds, applyAlignments and applyRoutes
  • leave applyRoutingPoints strict, an unknown id in a ChangeRoutingPointsOperation is a real error

Adjusting the apply step previously meant overriding executeAction, which also takes over the revision check and the model lock. ComputedBoundsActionHandler now dispatches through overridable per-kind methods, so an adopter can replace one kind and rebind the handler, as the workflow example does for other handlers.

LayoutUtil.applyRoute now returns Optional; noted in the changelog under potentially breaking changes.

Relates to eclipse-glsp/glsp#1727

How to test

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

@martin-fleck-at
martin-fleck-at force-pushed the issues/1727-resilient-computed-bounds branch from 06d515d to 8f2e6d3 Compare August 25, 2026 14:32
A single unresolvable element in a ComputedBoundsAction aborted the whole
batch: the client had already measured every element, but one stale id threw
and the server dropped the remaining bounds, alignments and routes along with
the model update the client was waiting for. Mirrors the same fix in
glsp-server-node.

- resolve elements through the index Optional instead of getOrThrow, so an
  unknown id yields an empty result
- report a route with fewer than two points as not applicable rather than as
  an error, a client may have nothing to report for an unmeasured edge yet
- log a skipped entry, routes at debug level because an edge the client has
  not finished routing yet is expected
- split the apply step into applyElementBounds, applyAlignments and applyRoutes
- leave applyRoutingPoints strict, an unknown id in a
  ChangeRoutingPointsOperation is a real error

Adjusting the apply step previously meant overriding executeAction, which also
takes over the revision check and the model lock. ComputedBoundsActionHandler
now dispatches through overridable per-kind methods, so an adopter can replace
one kind and rebind the handler, as the workflow example does for other
handlers.

LayoutUtil.applyRoute now returns Optional<GEdge>; noted in the changelog
under potentially breaking changes.

Relates to eclipse-glsp/glsp#1727
@martin-fleck-at
martin-fleck-at force-pushed the issues/1727-resilient-computed-bounds branch from 8f2e6d3 to 349a673 Compare August 25, 2026 15:15
- deprecate LayoutUtil.applyBounds(root, action, modelState), it calls the
  static per-kind methods and therefore skips the overridable ones on
  ComputedBoundsActionHandler
- point the batch test at the live per-kind methods, so the deprecated entry
  point has no callers left
- drop the duplicated TestGModelState from both tests, updateRoot on
  DefaultGModelState already builds and stores the index
- assert the applied route keeps only the intermediate point and puts source
  and target under their args keys
- keep the root parameter on the handler's applyBounds, glsp-server-node has
  the same signature and an override may want the root

Relates to eclipse-glsp/glsp#1727
@martin-fleck-at
martin-fleck-at force-pushed the issues/1727-resilient-computed-bounds branch from 7e09e12 to b1fb4e2 Compare August 26, 2026 09:10
@martin-fleck-at
martin-fleck-at merged commit 6f64d98 into master Aug 26, 2026
7 checks passed
@martin-fleck-at
martin-fleck-at deleted the issues/1727-resilient-computed-bounds branch August 26, 2026 12:06
@tortmayr tortmayr mentioned this pull request Aug 31, 2026
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.

2 participants