Skip to content

fix(jsonrpc): correct newline state machine in StreamMessageProducer#904

Merged
pisv merged 1 commit intoeclipse-lsp4j:mainfrom
sebthom:StreamMessageProducer_NewLineBug
Nov 8, 2025
Merged

fix(jsonrpc): correct newline state machine in StreamMessageProducer#904
pisv merged 1 commit intoeclipse-lsp4j:mainfrom
sebthom:StreamMessageProducer_NewLineBug

Conversation

@sebthom
Copy link
Contributor

@sebthom sebthom commented Oct 25, 2025

The listener sets newLine = false after parsing a blank line (end-of-headers) and then unconditionally sets it back to true, leaving the state inconsistent. This caused a lone trailing CRLF between messages to be misinterpreted as an additional blank line, triggering a "Missing header Content-Length" error via fireError.

This fix prevents spurious errors and ensures robust parsing across message boundaries.

The listener sets `newLine = false` after parsing a blank line
(end-of-headers) and then **unconditionally** sets it back to `true`,
leaving the state inconsistent. This caused a lone trailing CRLF between
messages to be misinterpreted as an additional blank line, triggering a
"Missing header Content-Length" error via `fireError`.

This fix prevents spurious errors and ensures robust parsing across
message boundaries.
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.

Good catch! Thank you for the fix 👍

@pisv pisv merged commit 4b6d14b into eclipse-lsp4j:main Nov 8, 2025
4 checks passed
@sebthom sebthom deleted the StreamMessageProducer_NewLineBug branch November 9, 2025 18:46
@jonahgraham jonahgraham added this to the 1.0.0 milestone Feb 9, 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.

3 participants