There seems to be a regression in PR #382 which was fixed in PR #349 (addressed in issue #347): Newly added line 364 in session.js is accessing <undefined>.length inside Buffer.concat() if trailing message frame has no payload.
const data = current.frames.length === 1 ? current.frames[0] : Buffer.concat(current.frames);
Problem seems to originate from line 322:
current.frames.push(frame.payload);
If the message has no payload this appends undefined to frames.
Stack trace (v3.0.1):
node:buffer:545
TypeError: Cannot read properties of undefined (reading 'length')
at Function.concat (node:buffer:545:19)
at Incoming.on_transfer (node_modules/rhea/lib/session.js:364:83)
at Session.on_transfer (node_modules/rhea/lib/session.js:764:19)
at Connection.<computed> [as on_transfer] (node_modules/rhea/lib/connection.js:855:30)
at c.dispatch (node_modules/rhea/lib/types.js:946:33)
at Transport.read (node_modules/rhea/lib/transport.js:117:36)
at SaslClient.read (node_modules/rhea/lib/sasl.js:344:26)
at Connection.input (node_modules/rhea/lib/connection.js:567:37)
at TLSSocket.emit (node:events:527:28)
There seems to be a regression in PR #382 which was fixed in PR #349 (addressed in issue #347): Newly added line 364 in
session.js
is accessing<undefined>.length
insideBuffer.concat()
if trailing message frame has no payload.Problem seems to originate from line 322:
If the message has no payload this appends
undefined
toframes
.Stack trace (v3.0.1):