• exec/broker.js

    From Deuc¿@VERT to Git commit to main/sbbs/master on Thu May 7 02:03:23 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/a57da0ce23000622e8aec090
    Modified Files:
    exec/broker.js
    Log Message:
    broker.js: fix subscriber registration for existing topics

    The Subscription constructor was writing to
    topics[i][this.client_id] (a dangling property on the Topic object
    with this.client_id being undefined) instead of topics[i].subscribers[conn.client_id]. This meant subscribers were
    never registered in the .subscribers map for topics that already
    existed at subscribe time. Retained messages still worked because
    they were sent directly from the constructor, but live publishes
    never found the subscriber.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Thu May 7 11:11:34 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/7b9c37f55f2dffb461610ac2
    Modified Files:
    exec/broker.js
    Log Message:
    broker.js: fix memory leaks from subscription references

    Subscription.remove() used topics[i][this.client_id] instead of topics[i].subscribers[this.conn.client_id] Ä the same property-path
    bug fixed in the constructor (a8a6bfebe). Subscriptions were never
    actually removed from Topic subscriber maps, keeping Connection
    objects alive through circular references indefinitely.

    Added removeAllSubscriptions() method and call it from:
    - tearDown() when session_expiry is 0 (no session persistence)
    - expireSession() before deleting from broker.disconnected
    - handleCONNECT when clean_start replaces an old connection

    Also clean up empty subscriber entries from topic maps after the
    last subscription for a client is removed.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net