Skip to content

Metadata (M) flag is not set from responder side when metadata has length #198

Open
@viglucci

Description

@viglucci

In _sendStreamPayload of RSocketMachineImpl, when flags is created, the flag for present Metadata (M) is not set, which causes the payload.metadata value to not be included in the encoded payload later in serializePayloadFrame.

https://github.com/rsocket/rsocket-js/blob/master/packages/rsocket-core/src/RSocketMachine.js#L885

Expected Behavior

Per spec, Metadata (M) flag must be set when the payload contains metadata.

Actual Behavior

Metadata (M) flag is not set, and the resulting encoded payload does not include metadata.

Steps to Reproduce

Attempt to send any metadata value on a payload from requestResponse or requestStream, the value received on the client will be null.

Possible Solution

if (metadata && metadata.length > 0) {
  // eslint-disable-next-line no-bitwise
  flags |= _RSocketFrame.FLAGS.METADATA;
}

Your Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.xIssues relating to 0.x version(s)bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions