project-nomad/admin
Chris Sherwood bbd62d8ed1
fix(content): remove superseded curated map/ZIM files when a new version installs
Only Wikipedia had version cleanup; every other curated map and non-Wikipedia
ZIM left its prior version on disk when a newer one installed, so users silently
accumulated orphaned content (potentially hundreds of GB). (#634)

The install paths already record each resource via InstalledResource
{resource_id, resource_type, version, file_path}, so the authoritative old-file
path for a resource is known. On install of a new version we now capture the
prior row before updateOrCreate repoints it, then delete the old file — gated
behind a pure, fully unit-tested decision function with strict safety rails:

  - tracked-only: requires a prior InstalledResource row for the same
    resource_id, so sideloaded/untracked files are never touched
  - genuine replacement: old and new file paths must differ
  - new-file-verified: the new file must be confirmed on disk first
  - strictly-newer: a re-install or downgrade can't wipe a newer file
  - within-storage-dir: the old path must resolve under the content store

ZIM cleanup deletes the old file directly (NOT via this.delete(), which would
drop the InstalledResource row by resource_id that updateOrCreate just
repointed) and rebuilds the Kiwix library only if a file was actually removed,
so its XML never references a deleted ZIM. Maps need no library step. Wikipedia
keeps its own existing cleanup path. All deletions are best-effort and logged;
a failure never breaks the install.

Closes #634

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 04:47:01 +00:00
..
app fix(content): remove superseded curated map/ZIM files when a new version installs 2026-06-23 04:47:01 +00:00
bin feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
commands feat(supply-depot): opt-in automatic updates for installed apps 2026-06-23 04:46:52 +00:00
config feat(config): respect REDIS_DB env var for queue and transmit 2026-06-23 04:46:51 +00:00
constants feat(supply-depot): opt-in automatic updates for installed apps 2026-06-23 04:46:52 +00:00
database feat(supply-depot): add custom launch URLs for apps 2026-06-23 04:46:56 +00:00
docs feat(supply-depot): per-app onboarding docs, install fixes, and in-app Docs links 2026-06-23 04:46:47 +00:00
inertia refactor(supply-depot): extract version and subtitle helpers instead of IIFE for readability 2026-06-23 04:47:00 +00:00
providers fix(kiwix): self-heal a missing or corrupt library XML on startup 2026-06-23 04:46:56 +00:00
public feat: switch all PNG images to WEBP (#575) 2026-04-03 14:26:50 -07:00
resources feat(Maps): regional map downloads via go-pmtiles extract (#780) 2026-05-20 10:16:00 -07:00
scripts fix(supply-depot): correct Meshtastic Web internal port (80->8080); add catalog port audit script 2026-06-23 04:46:46 +00:00
start feat(supply-depot): add custom launch URLs for apps 2026-06-23 04:46:56 +00:00
tests fix(content): remove superseded curated map/ZIM files when a new version installs 2026-06-23 04:47:01 +00:00
types feat(supply-depot): add custom launch URLs for apps 2026-06-23 04:46:56 +00:00
util feat: display model download progress 2026-02-06 16:22:23 -08:00
views feat: initial commit 2025-06-29 15:51:08 -07:00
.editorconfig feat: initial commit 2025-06-29 15:51:08 -07:00
.env.example feat(config): respect REDIS_DB env var for queue and transmit 2026-06-23 04:46:51 +00:00
ace.js feat: initial commit 2025-06-29 15:51:08 -07:00
adonisrc.ts feat(GPU): auto-remediate nomad_ollama passthrough loss on admin boot (#755) 2026-05-20 10:16:00 -07:00
eslint.config.js feat: openwebui+ollama and zim management 2025-07-09 09:08:21 -07:00
package-lock.json chore: align package license with Apache-2.0 and fix README docs links/typos 2026-06-23 04:46:50 +00:00
package.json chore: align package license with Apache-2.0 and fix README docs links/typos 2026-06-23 04:46:50 +00:00
tailwind.config.ts feat: initial commit 2025-06-29 15:51:08 -07:00
tsconfig.json feat: initial commit 2025-06-29 15:51:08 -07:00
vite.config.ts fix(Maps): ensure proper parsing of hostnames (#640) 2026-04-03 14:26:50 -07:00