experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(datastore): drop dead extensions SQLite table + getTilePath fallback

The extensions table was created on every boot via CREATE TABLE IF NOT
EXISTS but never written to anywhere — it predates the
manifestVersion: 3 unified registry. Only protocol.ts::getTilePath read
from it as a fallback for installed external tiles, wrapped in try so
new DBs without the table fell through silently.

After deletion every tile resolves through the in-process tilePaths
map (built-ins + dev-loaded). Existing users' DBs keep the table with
its rows, but nothing reads them anymore.

- backend/electron/datastore.ts: drop CREATE TABLE extensions block + 3 indexes
- backend/electron/protocol.ts: simplify getTilePath to a tilePaths.get
(deletes the SELECT FROM extensions fallback + shortname-by-metadata loop)

Build clean, unit tests 2277/0.

+2 -53
-22
backend/electron/datastore.ts
··· 153 153 CREATE INDEX IF NOT EXISTS idx_feeds_type ON feeds(type); 154 154 CREATE INDEX IF NOT EXISTS idx_feeds_enabled ON feeds(enabled); 155 155 156 - CREATE TABLE IF NOT EXISTS extensions ( 157 - id TEXT PRIMARY KEY, 158 - name TEXT, 159 - description TEXT DEFAULT '', 160 - version TEXT DEFAULT '1.0.0', 161 - path TEXT, 162 - backgroundUrl TEXT DEFAULT '', 163 - settingsUrl TEXT DEFAULT '', 164 - iconPath TEXT DEFAULT '', 165 - builtin INTEGER DEFAULT 0, 166 - enabled INTEGER DEFAULT 1, 167 - status TEXT DEFAULT 'installed', 168 - installedAt INTEGER, 169 - updatedAt INTEGER, 170 - lastErrorAt INTEGER DEFAULT 0, 171 - lastError TEXT DEFAULT '', 172 - metadata TEXT DEFAULT '{}' 173 - ); 174 - CREATE INDEX IF NOT EXISTS idx_extensions_enabled ON extensions(enabled); 175 - CREATE INDEX IF NOT EXISTS idx_extensions_status ON extensions(status); 176 - CREATE INDEX IF NOT EXISTS idx_extensions_builtin ON extensions(builtin); 177 - 178 156 CREATE TABLE IF NOT EXISTS feature_settings ( 179 157 id TEXT PRIMARY KEY, 180 158 featureId TEXT NOT NULL,
+2 -31
backend/electron/protocol.ts
··· 242 242 } 243 243 244 244 /** 245 - * Get tile filesystem path by ID. 246 - * First checks built-in tiles, then the datastore for installed (external) tiles. 245 + * Get tile filesystem path by ID. Built-in + dev-loaded tiles only. 247 246 */ 248 247 export function getTilePath(id: string): string | null { 249 - // Check built-in tiles first 250 - const builtinPath = tilePaths.get(id); 251 - if (builtinPath) return builtinPath; 252 - 253 - // Check datastore for installed (external) tiles 254 - try { 255 - const db = getDb(); 256 - const ext = db.prepare('SELECT * FROM extensions WHERE id = ?').get(id) as { path?: string } | undefined; 257 - if (ext && ext.path) { 258 - return ext.path; 259 - } 260 - 261 - // Also check by shortname (stored in metadata) 262 - const allExts = db.prepare('SELECT * FROM extensions').all() as Array<{ path?: string; metadata?: string }>; 263 - for (const extData of allExts) { 264 - try { 265 - const metadata = JSON.parse(extData.metadata || '{}'); 266 - if (metadata.shortname === id && extData.path) { 267 - return extData.path; 268 - } 269 - } catch { 270 - // Ignore JSON parse errors 271 - } 272 - } 273 - } catch { 274 - // Database not initialized yet 275 - } 276 - 277 - return null; 248 + return tilePaths.get(id) ?? null; 278 249 } 279 250 280 251 /**