From a43089782a03dd4e2acb194f3f3045743f031838 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Sun, 13 Sep 2026 19:49:23 +0200 Subject: [PATCH] fix(theseus/addons): reseed a bundled add-on only when the bundle is strictly newer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seedBundledAddons reseeded whenever the user copy's version differed from the bundled one. promoteStagedUpdates runs just before it, so a signed over-the-air update that had just been promoted (e.g. Aegis 0.6.14 over the bundled 0.6.2) was backed up and replaced by the older bundle on the same boot — every OTA add-on update silently reverted at the next launch. Reseed now only when the bundle is newer, using the same version compare the promoter uses. --- main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index dd73eab..6db3e05 100644 --- a/main.js +++ b/main.js @@ -1590,7 +1590,14 @@ function seedBundledAddons() { if (!bundleVer) continue; // broken bundle — skip rather than corrupt user state if (fs.existsSync(target)) { const userVer = readAddonVersion(target); - if (userVer === bundleVer) continue; + // Only reseed when the bundle is STRICTLY NEWER than what's in + // userData. The old check `userVer === bundleVer ? continue` would + // reseed whenever the versions differed — including the OTA case + // where promoteStagedUpdates just promoted a newer addon than the + // one baked into the installer, silently downgrading it on the same + // boot. Version-compare with the same cmpVer helper the promoter + // uses so both sides agree on ordering. + if (userVer && cmpVersions(userVer, bundleVer) >= 0) continue; // Backups go in a sibling folder so AddonHost's directory scan doesn't // pick them up as duplicate addons with the same manifest id. const backupsRoot = addonsBackupDir();