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

Deserialization error in the RSocketServer #217

Open
palamccc opened this issue Feb 28, 2022 · 0 comments
Open

Deserialization error in the RSocketServer #217

palamccc opened this issue Feb 28, 2022 · 0 comments
Labels
needs triage Issue/PR needs triage by a project maintainer

Comments

@palamccc
Copy link

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):
@viglucci viglucci added the needs triage Issue/PR needs triage by a project maintainer label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue/PR needs triage by a project maintainer
Projects
None yet
Development

No branches or pull requests

2 participants