You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using protocol version 5, calling writeToStream with userProperties being empty object {} method fails with false as return value.
This is the packet being written:
I traced the problem to getProperties method which returns false when userProperties is empty object {} because getLengthProperty for empty object returns 0 causing getProperties to return false:
While using protocol version 5, calling
writeToStream
withuserProperties
being empty object{}
method fails withfalse
as return value.This is the packet being written:
I traced the problem to
getProperties
method which returnsfalse
whenuserProperties
is empty object{}
becausegetLengthProperty
for empty object returns0
causinggetProperties
to returnfalse
:mqtt-packet/writeToStream.js
Line 1004 in 1f2cf7f
Setting
userProperties
to something like{'f': 'u'}
removes the issue.We are using ClientMqtt from
@nestjs/microservices
to emit data to a topic.It seems the ClientMqtt sets
userProperties
to empty object when nouserProperties
is provided:https://github.com/nestjs/nest/blob/e4b07eb06b406183e708269e0439f442a1dadb1c/packages/microservices/client/client-mqtt.ts#L217
The text was updated successfully, but these errors were encountered: