Skip to content

fix Constructor doesn't store fragmentation#307

Open
Niteesh wants to merge 1 commit intorsocket:1.0.x-alphafrom
Niteesh:1.0.x-alpha
Open

fix Constructor doesn't store fragmentation#307
Niteesh wants to merge 1 commit intorsocket:1.0.x-alphafrom
Niteesh:1.0.x-alpha

Conversation

@Niteesh
Copy link

@Niteesh Niteesh commented Mar 15, 2026

Bug
RSocketServer accepts a fragmentation.maxOutboundFragmentSize config, but it only applies to
the requester side (server-initiated requests). The responder side (server responses to client
requests) always uses fragmentSize=0, meaning responses are never fragmented.

This causes a crash when the server tries to send a response larger than 16MB (the RSocket frame
length field is 24-bit, max 16,777,215 bytes), because writeUInt24BE overflows:

RangeError: The value of "value" is out of range. It must be >= 0 and <= 255.
at writeUInt24BE (rsocket-core/src/Codecs.ts:80)
at serializeFrameWithLength (rsocket-core/src/Codecs.ts:161)
Root Cause
Two issues in packages/rsocket-core/src/RSocketServer.ts:

Constructor doesn't store fragmentation: The fragmentation field from ServerConfig is
never assigned to this, so this.fragmentation is always undefined.

DefaultStreamRequestHandler hardcodes fragmentSize=0: Even if this.fragmentation were
stored, the stream handler is created with fragmentSize=0 instead of using the configured value.

Signed-off-by: Niteesh niteesh3@gmail.com

… streams rsocket#306

Signed-off-by: Niteesh Kumar <niteesh3@gmail.com>
@Niteesh Niteesh changed the title 1.0.x alpha fix Constructor doesn't store fragmentation Mar 15, 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.

1 participant