From 15a0caa7b65a56fa43421364707ebd0ad9cec7b5 Mon Sep 17 00:00:00 2001 From: Kevin Viglucci Date: Sat, 11 Dec 2021 16:42:09 -0600 Subject: [PATCH 1/3] fix: add Metadata flag when sending stream payload which has metadata Signed-off-by: Kevin Viglucci --- packages/rsocket-core/src/RSocketMachine.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/rsocket-core/src/RSocketMachine.js b/packages/rsocket-core/src/RSocketMachine.js index 63f2554c..cee2d3b8 100644 --- a/packages/rsocket-core/src/RSocketMachine.js +++ b/packages/rsocket-core/src/RSocketMachine.js @@ -888,6 +888,10 @@ class RSocketMachineImpl implements RSocketMachine { flags |= FLAGS.COMPLETE; this._subscriptions.delete(streamId); } + if (metadata !== undefined) { + // 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({ From d0e13a8ca212ba7f925eed4fa00a161b5a5f0233 Mon Sep 17 00:00:00 2001 From: Kevin Viglucci Date: Sat, 11 Dec 2021 16:54:41 -0600 Subject: [PATCH 2/3] fix: reference metadata from payload Signed-off-by: Kevin Viglucci --- packages/rsocket-core/src/RSocketMachine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rsocket-core/src/RSocketMachine.js b/packages/rsocket-core/src/RSocketMachine.js index cee2d3b8..ae545bcc 100644 --- a/packages/rsocket-core/src/RSocketMachine.js +++ b/packages/rsocket-core/src/RSocketMachine.js @@ -888,7 +888,7 @@ class RSocketMachineImpl implements RSocketMachine { flags |= FLAGS.COMPLETE; this._subscriptions.delete(streamId); } - if (metadata !== undefined) { + if (payload.metadata !== undefined) { // eslint-disable-next-line no-bitwise flags |= FLAGS.METADATA; } From 639a967ab926cff90613e37fc25ebd5a3a42ec78 Mon Sep 17 00:00:00 2001 From: Kevin Viglucci Date: Mon, 3 Jan 2022 09:44:44 -0600 Subject: [PATCH 3/3] fix: check for udnefined as well as null in payload.metadata Signed-off-by: Kevin Viglucci --- packages/rsocket-core/src/RSocketMachine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rsocket-core/src/RSocketMachine.js b/packages/rsocket-core/src/RSocketMachine.js index ae545bcc..02bbb3cc 100644 --- a/packages/rsocket-core/src/RSocketMachine.js +++ b/packages/rsocket-core/src/RSocketMachine.js @@ -888,7 +888,8 @@ class RSocketMachineImpl implements RSocketMachine { flags |= FLAGS.COMPLETE; this._subscriptions.delete(streamId); } - if (payload.metadata !== undefined) { + if (payload.metadata !== undefined && + payload.metadata !== null) { // eslint-disable-next-line no-bitwise flags |= FLAGS.METADATA; }