From 4c1c23bd27364d58803a55ae178b14d99b25a457 Mon Sep 17 00:00:00 2001 From: Franz Rolfsvaag Date: Wed, 17 Jun 2026 16:49:23 +0200 Subject: [PATCH] fix repo update cache cleanup --- TODO.md | 1 + package-lock.json | 4 ++-- package.json | 2 +- scripts/verify-webui.js | 15 ++++++++++++++- src/services/update-manager.js | 3 +-- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index fd9fd27..9f16829 100644 --- a/TODO.md +++ b/TODO.md @@ -125,6 +125,7 @@ This file tracks larger Lumi work that cannot safely be completed in one pass. K ## Done +- 2026-06-17: Fixed repo-based core updates deleting `data/update-cache/repo` during apply, added a verification guard, and bumped core package version to v0.1.4. - 2026-06-17: Bumped core package version to v0.1.3. - 2026-06-17: Completed homepage hero embed pass for Discord widgets, YouTube video playback options, external embed fallback/sandbox controls, admin validation, platform-specific fields, and Test preview behavior. - 2026-06-17: Fixed core update snapshots for large ZIP-origin installs by replacing the full-install ZIP backup with a filesystem snapshot directory, avoiding the 2 GiB ZIP limit for large preserved files such as local AI models. diff --git a/package-lock.json b/package-lock.json index a9a6fc3..21190d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lumi-bot", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lumi-bot", - "version": "0.1.3", + "version": "0.1.4", "dependencies": { "adm-zip": "^0.5.12", "better-sqlite3": "^11.5.0", diff --git a/package.json b/package.json index dd658f6..b0adef8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lumi-bot", - "version": "0.1.3", + "version": "0.1.4", "private": true, "type": "commonjs", "scripts": { diff --git a/scripts/verify-webui.js b/scripts/verify-webui.js index 6c54a28..39fe648 100644 --- a/scripts/verify-webui.js +++ b/scripts/verify-webui.js @@ -176,6 +176,19 @@ function verifyThemeService() { } } +function verifyUpdateCachePreserved() { + const updateManagerPath = path.join(root, "src", "services", "update-manager.js"); + const source = fs.readFileSync(updateManagerPath, "utf8"); + const generatedPaths = source.match(/const GENERATED_RELATIVE_PATHS = new Set\(\[([\s\S]*?)\]\);/); + assert(generatedPaths, "Could not find generated path cleanup list."); + assert( + !generatedPaths[1].includes('"data/update-cache"') && + !generatedPaths[1].includes("'data/update-cache'"), + "Core update cleanup must not delete data/update-cache because repo updates apply from data/update-cache/repo." + ); +} + const viewCount = verifyViews(); verifyThemeService(); -console.log(`WebUI verification passed: ${viewCount} EJS views and theme CRUD.`); +verifyUpdateCachePreserved(); +console.log(`WebUI verification passed: ${viewCount} EJS views, theme CRUD, and update-cache preservation.`); diff --git a/src/services/update-manager.js b/src/services/update-manager.js index 788c4d0..101c916 100644 --- a/src/services/update-manager.js +++ b/src/services/update-manager.js @@ -48,8 +48,7 @@ const GENERATED_RELATIVE_PATHS = new Set([ ".parcel-cache", ".turbo", "tmp", - "temp", - "data/update-cache" + "temp" ]); const SNAPSHOT_EXCLUDE_RELATIVE_PATHS = new Set([ ".git",