openvibers/openvibe.network Commits

Built-in theme sync removes rows for built-ins that no longer exist (renamed slugs left a stale copy)

OP OpenVibers committed 17 Sept 2026 · c32f66c0d3 · 1 file, +4 −1


Changes

ddiff --git a/server/db/database.js b/server/db/database.js
iindex 9700231b..f9328525 100644
---- a/server/db/database.js
++++ b/server/db/database.js
@@@ -710,7 +710,10 @@ function initDb(dbPath) {
JSON.stringify(t.tags || [])
);
}
-- console.log(`[DB] Synced ${BUILTIN_THEMES.length} built-in themes`);
++ // A built-in that was renamed or removed must not linger as a stale catalog row.
++ const ids = BUILTIN_THEMES.map((t) => t.id);
++ const gone = db.prepare(`DELETE FROM themes WHERE is_builtin = 1 AND id NOT IN (${ids.map(() => '?').join(',')})`).run(...ids).changes;
++ console.log(`[DB] Synced ${BUILTIN_THEMES.length} built-in themes${gone ? ` (removed ${gone} stale)` : ''}`);
}
// ── Sync Roles From Linked OpenVibe.Live Accounts ────────