Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GLSPClient implementations #1438

Closed
tortmayr opened this issue Dec 5, 2024 · 1 comment
Closed

Improve GLSPClient implementations #1438

tortmayr opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working client

Comments

@tortmayr
Copy link
Contributor

tortmayr commented Dec 5, 2024

Starting and initializing a GLSP is currently done in the diagram loader

  • The loader will start and initialize the GLSPClient in its initialize phase
  • In addition, it is also possible to preinitialize the Client in an early step and pass an already running and initialized client to the diagram loader (like its e.g. done in the Theia integration)

To easily enable this behavior the start and initializeServer methods of the default implementations are designed in a way so that consecutive calls after the initial calls have not effect or return the cached result from the first call.
In theory this works well, but there are certain cases were this behavior could fail:
Invoking start or initializeServer again while the previous/first request/promise is still resolving does not work as expected.
For start in this a resolved promise is returned immediately. This indicates to the awaiting party that start has finished and the client is ready, but since the inital promise is still resolving the client is still in Starting state.
For initializeServer in this case a second initializeRequest will be sent to the server. This should not happen instead the currently pending promise should be returned.

@tortmayr tortmayr added bug Something isn't working client labels Dec 5, 2024
@martin-fleck-at
Copy link
Contributor

Fixed with eclipse-glsp/glsp-client#402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client
Projects
None yet
Development

No branches or pull requests

2 participants