openvibers/openvibe.live Commits
Deploy notice: query only the columns the table has
Changes
@@@ -53,7 +53,7 @@ const plainText = (meta) => `๐ ${meta.commits.length} update${meta.commits.le/** Insert a notice, or fold into the newest row when that row is itself a recent deploy notice. */function persist(db, commits) {const nowIso = new Date().toISOString();-- const newest = db.get('SELECT id, message_type, metadata, created_at FROM chat_messages WHERE is_global = 1 AND is_deleted = 0 ORDER BY id DESC LIMIT 1');++ const newest = db.get('SELECT id, message_type, metadata FROM chat_messages WHERE is_global = 1 AND is_deleted = 0 ORDER BY id DESC LIMIT 1');let prev = null;if (newest && newest.message_type === 'system' && newest.metadata) {try { const m = JSON.parse(newest.metadata); if (m && m.kind === 'deploy' && Date.now() - Date.parse(m.first_at) < FOLD_WINDOW_MS) prev = m; } catch { /* not ours */ }
@@ -53,7 +53,7 @@ const plainText = (meta) => `๐ ${meta.commits.length} update${meta.commits.le
@@ -53,7 +53,7 @@ const plainText = (meta) => `๐ ${meta.commits.length} update${meta.commits.le
/** Insert a notice, or fold into the newest row when that row is itself a recent deploy notice. */
/** Insert a notice, or fold into the newest row when that row is itself a recent deploy notice. */
function persist(db, commits) {
function persist(db, commits) {
const nowIso = new Date().toISOString();
const nowIso = new Date().toISOString();
- const newest = db.get('SELECT id, message_type, metadata, created_at FROM chat_messages WHERE is_global = 1 AND is_deleted = 0 ORDER BY id DESC LIMIT 1');
+ const newest = db.get('SELECT id, message_type, metadata FROM chat_messages WHERE is_global = 1 AND is_deleted = 0 ORDER BY id DESC LIMIT 1');
let prev = null;
let prev = null;
if (newest && newest.message_type === 'system' && newest.metadata) {
if (newest && newest.message_type === 'system' && newest.metadata) {
try { const m = JSON.parse(newest.metadata); if (m && m.kind === 'deploy' && Date.now() - Date.parse(m.first_at) < FOLD_WINDOW_MS) prev = m; } catch { /* not ours */ }
try { const m = JSON.parse(newest.metadata); if (m && m.kind === 'deploy' && Date.now() - Date.parse(m.first_at) < FOLD_WINDOW_MS) prev = m; } catch { /* not ours */ }