Skip to content

Deserialization error in the RSocketServer #217

Open
@palamccc

Description

@palamccc

I'm trying to use RSocketServer in javascript, but when I provide serializers option, the frames are getting deserialized twice.

const server = new RSocketServer<string, string>({
    // ....
   getRequestHandler: socket => ({
      requestChannel: payloads => handleRequestChannel(socket, payloads),
    }),
    serializers: JsonSerializers,
});

I added breakpoints and found the two locations where it is getting deserialized.

The first deserialization is happening here,
https://github.com/rsocket/rsocket-js/blob/v0.0.27/packages/rsocket-core/src/RSocketMachine.js#L711-L714

The second deserialization is happening here,
https://github.com/rsocket/rsocket-js/blob/v0.0.27/packages/rsocket-core/src/RSocketMachine.js#L832

During second deserialization RSocketServer is crashing with this error,

image

Expected Behavior

The frame should be deserialized only once.

Actual Behavior

It's getting deserialized in two places in the data pipeline.

Steps to Reproduce

I don't have a test case at the moment.

Possible Solution

Review the data pipeline and remove the second deserialization.
Add a test case to test serializers

Your Environment

  • RSocket version(s) used: 0.0.27
  • Other relevant libraries versions (eg. netty, ...):
  • Platform (eg. JVM version (javar -version) or Node version (node --version)):
  • OS and version (eg uname -a):

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue/PR needs triage by a project maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions