From a86bced1640ac1a695b95ac68b95e3fc581e687d Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 12:57:51 +0200 Subject: refactor(chat): no thread_id — chat has no threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing ever set it (the page and the CLI sent null) and nothing read it (the node's get_thread had no caller). It is no longer sent by the page or the CLI, in clear or in the sealed payload, nor relayed or served by the node; get_thread and its index are gone, and the protocol and design docs no longer name it. The node still accepts a chat_msg carrying one, from the desktop apps and CLIs already installed, and drops it. The column stays, empty, in chat.db: a node downgraded to an older version names it in every query. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/src/meshbay_hub/static/chat-app.js | 7 +++---- packages/meshbay-hub/src/meshbay_hub/static/transport-chat.js | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'packages/meshbay-hub/src') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js index 1d61c43..34e86eb 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js @@ -472,7 +472,7 @@ function ChatPanel({ transportRef, username, userId, entries, gekRef, setSending(true); setInput(''); try { - await transport.sendChat(text, 0, null, username); + await transport.sendChat(text, 0, username); setMessages(prev => [...prev, { id: `own-${Date.now()}-${Math.random().toString(36).slice(2)}`, own: true, @@ -480,7 +480,6 @@ function ChatPanel({ transportRef, username, userId, entries, gekRef, sender_name: username, payload: text, timestamp: Date.now() / 1000, - thread_id: null, }]); jumpToBottom(); if (onActivity) onActivity(); @@ -515,11 +514,11 @@ function ChatPanel({ transportRef, username, userId, entries, gekRef, const structured = JSON.stringify({ text: '', attachment: { filename: storedAs, size: file.size, type: ftype }, }); - await transport.sendChat(structured, 0, null, username); + await transport.sendChat(structured, 0, username); setMessages(prev => [...prev, { id: `own-${Date.now()}-${Math.random().toString(36).slice(2)}`, own: true, sender_id: userId || username, sender_name: username, - payload: structured, timestamp: Date.now() / 1000, thread_id: null, + payload: structured, timestamp: Date.now() / 1000, }]); jumpToBottom(); } catch (err) { diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport-chat.js b/packages/meshbay-hub/src/meshbay_hub/static/transport-chat.js index 9ce07bc..3efbb22 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/transport-chat.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/transport-chat.js @@ -138,7 +138,6 @@ extendTransport(class { sender_id: row.sender_id, sender_name: row.sender_name || '', timestamp: row.timestamp, - thread_id: row.thread_id, }; const format = row.format || 0; if (format === 0) { @@ -169,7 +168,7 @@ extendTransport(class { * post in clear into a group whose members believe their chat is encrypted; * the node refuses it too, and the two refusals agreeing is the point. */ - async sendChat(text, iteration, threadId, senderName) { + async sendChat(text, iteration, senderName) { const keys = await this.chatKeys(); const epoch = this.chatEpoch || keys.current; const epochKey = keys.byEpoch.get(epoch); @@ -182,7 +181,6 @@ extendTransport(class { const gid = this._groupId || ''; const plaintext = msgpack_encode({ text: String(text), - thread_id: threadId || null, sender_name: senderName || '', sent_at: Math.floor(Date.now() / 1000), }); @@ -204,7 +202,6 @@ extendTransport(class { nonce, device, sig, - thread_id: threadId || null, // Deliberately absent: the display name is inside the envelope now. sender_name: null, }); @@ -315,7 +312,6 @@ extendTransport(class { ...base, payload: String(plain.text || ''), sender_name: plain.sender_name || base.sender_name, - thread_id: plain.thread_id ?? base.thread_id, device: deviceB64, verified: true, trust, -- cgit v1.2.3