Skip to content

Conversation

@sebthom
Copy link
Contributor

@sebthom sebthom commented Oct 26, 2025

This PR addresses #593

Previously only StreamMessageConsumer was treated as "sending". With WebSocket and other non-stream transports, sentRequests stayed empty, so every incoming response looked unmatched, emitted a warning, and produced no trace.

Now any consumer that is not a RemoteEndpoint is treated as "sending", ensuring sentRequests is populated regardless of transport and responses are matched correctly. Removed the "Unknown MessageConsumer type" branch to avoid misclassification and improve compatibility with custom/non-stream transports.

Copy link
Contributor

@pisv pisv left a comment

Choose a reason for hiding this comment

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

Looks good to me, except for a couple of nitpicks about the test.

If more flexibility is needed in the future, a special interface like IncomingMessageConsumer can be introduced and implemented by the RemoteEndpoint. Having said that, I think that it'd be better to keep it simple currently, just as the proposed implementation does.

- Previously only StreamMessageConsumer was treated as "sending". With
WebSocket and other non-stream transports, sentRequests stayed empty, so
every incoming response looked unmatched, emitted a warning, and
produced no trace.
- Now any consumer that is not a RemoteEndpoint is treated as "sending",
ensuring sentRequests is populated regardless of transport and responses
are matched correctly.
- Removed the "Unknown MessageConsumer type" branch to avoid
misclassification and improve compatibility with custom/non-stream
transports.
@sebthom sebthom force-pushed the TracingMessageConsumer branch from f07e4fb to 3ddee15 Compare November 9, 2025 17:36
@sebthom sebthom requested a review from pisv November 9, 2025 17:36
Copy link
Contributor

@pisv pisv left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the fix 👍

@pisv pisv merged commit 978b324 into eclipse-lsp4j:main Nov 9, 2025
4 checks passed
@sebthom sebthom deleted the TracingMessageConsumer branch November 9, 2025 18:45
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