Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: log restores, category archives, backup deletes and app removals (#12979) (#13034)

[._.]/8768a3a79a76
diff --git a/server/services/apps.js b/server/services/apps.js
index bc277229fe..d1c8f12398 100644
--- a/server/services/apps.js
+++ b/server/services/apps.js
@@ -414,6 +414,7 @@ async function deleteAppUnlocked(id) {
delete data.apps[id];
await saveApps(data);
+ console.log(`🗑️ Removed app ${id} from registry`);
return true;
}
diff --git a/server/services/backup.js b/server/services/backup.js
index a46ac689f3..450f7fd753 100644
--- a/server/services/backup.js
+++ b/server/services/backup.js
@@ -1975,6 +1975,7 @@ async function restoreHeldSnapshot({ snapshotDir, currentSource }, snapshotId, {
}
const scope = subdirFilter;
+ console.log(`💾 Restore starting: snapshot ${snapshotId}${scope ? ` (filter ${scope})` : ''}`);
let restoredLegacy = { stores: [], migrations: null };
let restoredLegacyLedger = legacyLedger;
// Conversion parks live stores, so it runs only after a successful transfer,
@@ -1996,6 +1997,7 @@ async function restoreHeldSnapshot({ snapshotDir, currentSource }, snapshotId, {
return changed;
},
}));
+ console.log(`💾 Restore complete: snapshot ${snapshotId}, ${changedFiles.length} files changed`);
return { dryRun, snapshotId, subdirFilter, changedFiles, verification, ...restoreNotes(restoredLegacy, restoredLegacyLedger) };
}
diff --git a/server/services/backup.test.js b/server/services/backup.test.js
index 698f658997..7a06e219e0 100644
--- a/server/services/backup.test.js
+++ b/server/services/backup.test.js
@@ -3826,6 +3826,30 @@ describe('restoreSnapshot snapshotId, filter flags, and settings re-sync', () =>
});
});
+ describe('restore log lines (#12979)', () => {
+ it('logs start and completion for an executed restore, with the snapshot id and changed-file count', async () => {
+ const log = vi.spyOn(console, 'log').mockImplementation(() => {});
+ try {
+ await runRestore('/dest', '2026-01-02T03:04:05.678Z', { dryRun: false });
+ expect(log).toHaveBeenCalledWith('💾 Restore starting: snapshot 2026-01-02T03:04:05.678Z');
+ expect(log).toHaveBeenCalledWith('💾 Restore complete: snapshot 2026-01-02T03:04:05.678Z, 0 files changed');
+ } finally {
+ log.mockRestore();
+ }
+ });
+
+ it('stays silent for a preview', async () => {
+ const log = vi.spyOn(console, 'log').mockImplementation(() => {});
+ try {
+ await runRestore('/dest', '2026-01-02T03:04:05.678Z');
+ expect(log).not.toHaveBeenCalledWith(expect.stringContaining('Restore starting'));
+ expect(log).not.toHaveBeenCalledWith(expect.stringContaining('Restore complete'));
+ } finally {
+ log.mockRestore();
+ }
+ });
+ });
+
describe('subdirFilter rsync flags', () => {
it('reads a legacy flat snapshot when that source is explicitly selected', async () => {
await runRestore('/dest', 'legacy-snapshot', { source: '@legacy', dryRun: true });
diff --git a/server/services/dataManager.js b/server/services/dataManager.js
index 15d0898ed7..ac6daf4f0b 100644
--- a/server/services/dataManager.js
+++ b/server/services/dataManager.js
@@ -552,9 +552,12 @@ export async function archiveCategory(categoryKey, options = {}) {
}
});
}
- return categoryKey === 'health'
- ? { archived: capturedDays.length, removed, retained, alreadyAbsent, archivePath: relative(process.cwd(), archivePath), size: archiveStat.size }
- : { archived: 0, archivePath: relative(process.cwd(), archivePath), archiveSize: archiveStat.size };
+ if (categoryKey === 'health') {
+ console.log(`📦 Archived data/health to ${archiveName}: ${capturedDays.length} days, ${removed} removed, ${retained} retained, ${alreadyAbsent} already absent`);
+ return { archived: capturedDays.length, removed, retained, alreadyAbsent, archivePath: relative(process.cwd(), archivePath), size: archiveStat.size };
+ }
+ console.log(`📦 Archived data/${categoryKey} to ${archiveName}`);
+ return { archived: 0, archivePath: relative(process.cwd(), archivePath), archiveSize: archiveStat.size };
} finally {
await rmGuarded(operationDir, { recursive: true, force: true });
}
@@ -694,5 +697,6 @@ export async function deleteBackup(filename) {
throw new ServerError('Path traversal not allowed', { status: 400, code: 'VALIDATION_ERROR' });
}
await rmGuarded(fullPath);
+ console.log(`🗑️ Deleted backup archive ${filename}`);
return { deleted: filename };
}