BBS:      TELESC.NET.BR
Assunto:  exec/broker.js
De:       Deuc¨
Data:     Wed, 6 May 2026 23:58:20 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/b524c0aa3fea3ee8a720de34
Modified Files:
	exec/broker.js
Log Message:
broker.js: fix PUBLISH payload framing and subscription ID handling

serializePayload() was wrapping the payload with encodeBinaryData() or
encodeUTF8String(), both of which prepend a 2-byte length prefix. MQTT
PUBLISH payloads are raw  the length is implicit from the fixed header's
remaining length field. This caused all forwarded messages to have garbage
bytes prepended.

dupeForSubscriptions() was collecting topic filter strings (the object
keys from the subscriber map) instead of the subscription_id from
each Subscription object. Also skip null/zero subscription IDs rather
than encoding them as property 11 value 0, which violates the MQTT 5.0
spec (SubscriptionIdentifier must be in the range 1-268435455).

Co-Authored-By: Claude Opus 4.6 (1M context) 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]