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: retain existing retention regression after integration

[._.]/ Adam Eivy756307aa0972
diff --git a/server/services/backup.test.js b/server/services/backup.test.js
index 5e38175b5c..29280430dd 100644
--- a/server/services/backup.test.js
+++ b/server/services/backup.test.js
@@ -4761,29 +4761,6 @@ describe('runBackup lifecycle', () => {
return dir;
}
- it('logs a failed retention inventory without failing the completed backup or deleting snapshots', async () => {
- const fsp = await actualFs();
- const old = await seedSnapshot(machineHost, '2020-01-01T00-00-00', { generatedAt: '2020-01-01T00:00:00.000Z' });
- const sourceRoot = joinPath(destRoot, 'snapshots', machineHost);
- vi.spyOn(fs, 'readdir').mockImplementation((path, ...args) => String(path) === sourceRoot
- ? Promise.reject(Object.assign(new Error('private storage detail'), { code: 'EACCES' }))
- : fsp.readdir(path, ...args));
- const errorLog = vi.spyOn(console, 'error').mockImplementation(() => {});
- const io = { emit: vi.fn() };
- const proc = fakeProc();
- spawn.mockReturnValue(proc);
- const pending = runBackup(destRoot, io, { retentionCount: 1 });
- await waitFor(() => spawn.mock.calls.length === 1, 'rsync spawn');
- proc.emit('close', 0);
-
- await expect(pending).resolves.toMatchObject({ status: 'ok', prunedSnapshots: 0 });
- await expect(fsp.stat(old)).resolves.toBeDefined();
- expect(io.emit).toHaveBeenCalledWith('backup:completed', expect.objectContaining({ status: 'ok' }));
- expect(errorLog).toHaveBeenCalledWith('❌ Backup retention prune failed: Backup inventory unavailable: read-retention-namespace (EACCES)');
- expect(errorLog.mock.calls.flat().join(' ')).not.toContain('private storage detail');
- expect(isBackupInProgress()).toBe(false);
- });
-
it('prunes only the oldest completed snapshots in the current machine namespace, keeping failed/in-progress/other-source snapshots', async () => {
const fsp = await actualFs();
const old1 = await seedSnapshot(machineHost, '2020-01-01T00-00-00', { generatedAt: '2020-01-01T00:00:00.000Z' });