Skip to content

GLSP-1828: Fix model initialization never completing in IdeActionDispatcher - #153

Merged
tortmayr merged 1 commit into
masterfrom
fix-model-initialization-intercepted-response
Nov 17, 2026
Merged

tortmayr merged 1 commit into
masterfrom
fix-model-initialization-intercepted-response

Conversation

@tortmayr

Copy link
Copy Markdown
Contributor

What it does

Since eclipse-glsp/glsp-server#283 client requests go through ActionDispatcher.request(), so the SetModelAction answering the initial RequestModelAction is intercepted as a pending response and never reaches runAction(). IdeActionDispatcher only notified the ModelInitializationConstraint there, so onceModelInitialized() never completed.

  • Override interceptPendingResponse() in IdeActionDispatcher to also notify the constraint about intercepted responses
  • Introduce a server/tests module with a Tycho test fragment for org.eclipse.glsp.ide.editor, run as part of mvn clean verify
  • Add JUnit 5 to both target platforms. r2025-12 pulls 5.11.4 from the 2025-03 release because the Tycho 4.0.8 surefire provider cannot run JUnit 5.12+
  • Add IdeActionDispatcherTest with a regression test for the intercepted SetModelAction

Fixes eclipse-glsp/glsp#1828

How to test

mvn -f server clean verify
mvn -f server clean verify -Dp2.target=r2023-12
  • Both target platforms build and the tests pass (verified locally)
  • initializesWhenSetModelAnswersModelRequest times out without the fix in IdeActionDispatcher
  • Manually verified in the workflow example: a custom IdeActionDispatcher dispatching a SelectAction in onceModelInitialized() selects the element once the diagram is open

Follow-ups

  • Backport to the 2.8.0.javax line
  • More unit tests for the editor bundle (e.g. IdeMessageUtil, GLSPEditorRegistry, UrlUtils) in a separate PR
  • Bump Tycho so the r2025-12 target can use its own JUnit version

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)

…atcher

Since glsp-server#283 client requests go through
ActionDispatcher.request(), so the SetModelAction answering the
initial RequestModelAction is intercepted in dispatch() and never
reaches runAction(). IdeActionDispatcher only notified the
ModelInitializationConstraint there, so onceModelInitialized() never
completed.

- Notify the constraint about intercepted responses as well
- Guard the constraint check with a lock, as intercepted responses
  arrive on the calling thread instead of the dispatcher thread.
  The future is completed outside the lock so onInitialized()
  callbacks cannot deadlock with a concurrent notification
- Introduce a server/tests module with a Tycho test fragment for
  org.eclipse.glsp.ide.editor, run as part of `mvn clean verify`
- Add JUnit 5 to both target platforms. r2025-12 pulls 5.11.4 from
  the 2025-03 release because the Tycho 4.0.8 surefire provider
  cannot run JUnit 5.12+
- Add a regression test for the intercepted SetModelAction

Fixes eclipse-glsp/glsp#1828
@tortmayr
tortmayr force-pushed the fix-model-initialization-intercepted-response branch from ec227e3 to 45c2ba3 Compare November 17, 2026 16:04
@tortmayr
tortmayr merged commit 425a9f9 into master Nov 17, 2026
4 checks passed
@tortmayr
tortmayr deleted the fix-model-initialization-intercepted-response branch November 17, 2026 16:19
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.

[Eclipse] Model initialization never completes since 2.7.0

1 participant