Skip to content

GLSP-1717: Fix bounds computation error after diagram export#525

Open
tortmayr wants to merge 1 commit into
masterfrom
issue/1717
Open

GLSP-1717: Fix bounds computation error after diagram export#525
tortmayr wants to merge 1 commit into
masterfrom
issue/1717

Conversation

@tortmayr

Copy link
Copy Markdown
Contributor

What it does

Exports render the diagram through the hidden viewer, so the GLSPHiddenBoundsUpdater
collected bounds and routing points for the export clone but never cleaned them up.
The stale entries leaked into the next computedBounds action, causing
Model element not found server errors when elements had been deleted in the meantime.

  • Always reset the collected bounds data and routing points at the end of postUpdate
    (via try/finally), regardless of the rendering cause or errors during the computation

Fixes eclipse-glsp/glsp#1717

How to test

pnpm install && pnpm build
pnpm -C examples/workflow-standalone start
  1. Select a task node first (selecting an element after the export triggers a local
    bounds computation that resets the leaked state and masks the bug)
  2. Trigger the SVG export with Ctrl+Shift+E
  3. Delete the selected node with Del

Without this fix, the computedBounds response contains stale entries for every element
of the export clone (including the deleted one) and the server rejects the update with
Could not retrieve element with id: 'task_ChkTp_icon'. With the fix, the update succeeds.

  • Verified locally against the workflow example (node server)

Follow-ups

The same early-return-without-cleanup flaw exists upstream in sprotty's
HiddenBoundsUpdater, so plain-sprotty adopters are affected too. Worth filing upstream.

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)

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Preview: Open browser example

Deployed from commit d55af1b.

Exports render the diagram through the hidden viewer, so the hidden
bounds updater collected bounds and routing points for the export clone
but never cleaned them up. The stale entries leaked into the next
computedBounds action, causing 'Model element not found' server errors
when elements had been deleted in the meantime.

- Always reset collected bounds data and routing points in postUpdate,
  regardless of the rendering cause or errors during computation

Fixes eclipse-glsp/glsp#1717
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.

Compute bounds after export throws exception for deleted element

1 participant