From 906a6f1cd1d22ab318e8603eff81157791f4f413 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Mon, 21 Sep 2026 22:52:57 +0200 Subject: [PATCH] theseus 0.3.51: profile relocation looks for the actual old dir name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.3.50's relocateProfile checked for %APPDATA%\Theseus Navigator\, but Electron's userData path is derived from app.getName(), which reads package.json's top-level "name" ("theseus-navigator") because there is no top-level productName — the "productName": "Theseus Navigator" in this file lives under "build", where electron-builder reads it for the installer, not where Electron reads it for the runtime path. So the folder the user's Theseus writes to is %APPDATA%\theseus-navigator\, never %APPDATA%\Theseus Navigator\. On 0.3.50 that meant relocateProfile found nothing at its search path, returned the new Theseus\ location, and Electron happily created a fresh empty profile there. The user's addons, vault, bookmarks and settings stayed in theseus-navigator\ but the running Theseus was no longer looking at them. Losing the vault is not something the user can recover from. Check both candidate names — the one the code was written for and the one that actually exists — and migrate whichever is present. If the new Theseus\ already exists (Windows fresh installs after 0.3.51), we leave it alone. --- main.js | 20 ++++++++++++++++---- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index 49508a43..66ff328b 100644 --- a/main.js +++ b/main.js @@ -32,11 +32,23 @@ if (process.env.THESEUS_USER_DATA) { catch (e) { console.warn("profile relocation failed:", e?.message); } } function relocateProfile(appData) { - const oldDir = path.join(appData, "Theseus Navigator"); const newDir = path.join(appData, "Theseus"); - if (!fs.existsSync(newDir) && fs.existsSync(oldDir)) { - try { fs.renameSync(oldDir, newDir); } - catch { fs.cpSync(oldDir, newDir, { recursive: true }); } + // Two possible previous locations: "Theseus Navigator" (what the code + // originally checked for, based on the assumed productName), and + // "theseus-navigator" (what Electron ACTUALLY used because package.json + // has no top-level productName, so app.getName() falls back to the "name" + // field). Whichever exists is the profile the user has been running + // against; migrate it in place so 0.3.51 does not silently create a fresh + // Theseus\ next to a still-populated old dir the user cannot see. + if (fs.existsSync(newDir)) return newDir; + for (const candidate of ["Theseus Navigator", "theseus-navigator"]) { + const oldDir = path.join(appData, candidate); + if (!fs.existsSync(oldDir)) continue; + try { fs.renameSync(oldDir, newDir); return newDir; } + catch { + try { fs.cpSync(oldDir, newDir, { recursive: true }); return newDir; } + catch (e) { console.warn(`[profile] relocate ${candidate} failed:`, e?.message); } + } } return newDir; } diff --git a/package-lock.json b/package-lock.json index 19383f7e..f46e67bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "dependencies": { "@bch-wc2/interfaces": "^0.0.16", "@bitauth/libauth": "^3.1.0-next.8", diff --git a/package.json b/package.json index 39ca269b..23b7d44e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", "main": "main.js",