Skip to content

Commit

Permalink
fix: add Metadata flag when sending stream payload which has metadata (
Browse files Browse the repository at this point in the history
…rsocket#200)

* fix: add Metadata flag when sending stream payload which has metadata

Signed-off-by: Kevin Viglucci <[email protected]>

* fix: reference metadata from payload

Signed-off-by: Kevin Viglucci <[email protected]>

* fix: check for udnefined as well as null in payload.metadata

Signed-off-by: Kevin Viglucci <[email protected]>
  • Loading branch information
viglucci authored Jan 5, 2022
1 parent 680976a commit cdfa824
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/rsocket-core/src/RSocketMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,11 @@ class RSocketMachineImpl<D, M> implements RSocketMachine<D, M> {
flags |= FLAGS.COMPLETE;
this._subscriptions.delete(streamId);
}
if (payload.metadata !== undefined &&
payload.metadata !== null) {
// eslint-disable-next-line no-bitwise
flags |= FLAGS.METADATA;
}
const data = this._serializers.data.serialize(payload.data);
const metadata = this._serializers.metadata.serialize(payload.metadata);
this._connection.sendOne({
Expand Down

0 comments on commit cdfa824

Please sign in to comment.