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: isolate prune review coverage (#5532)

[._.]/ Adam Eivy2ff19a738cc9
diff --git a/server/lib/conflictJournal.js b/server/lib/conflictJournal.js
index 9f1a50a973..3d70beceb6 100644
--- a/server/lib/conflictJournal.js
+++ b/server/lib/conflictJournal.js
@@ -364,7 +364,8 @@ export function flushBaseHashes() {
*
* Two caller shapes use it: the `peer:online` convergence walk
* `retryPendingPushesForPeer` (pushes — and stamps — every subscribed record in
- * sequence), and every `pruneTombstoned*` hard-prune loop, which EVICTS a base
+ * sequence), and the direct await-separated eviction loops in the mood-board,
+ * music-video-project, and commission-feedback prune paths. Each EVICTS a base
* hash per hard-deleted record. Eviction only marks `_baseDirty` for a key the
* map actually held, so a prune that removed nothing still costs zero writes.
*
diff --git a/server/services/moodBoard/db.test.js b/server/services/moodBoard/db.test.js
index 1563ea49b4..e843ef478b 100644
--- a/server/services/moodBoard/db.test.js
+++ b/server/services/moodBoard/db.test.js
@@ -9,7 +9,7 @@
* up its own rows after (only rows it created — no global table mutation).
*/
-import { describe, it, expect, afterAll, beforeAll, vi } from 'vitest';
+import { describe, it, expect, afterAll, beforeAll, beforeEach, vi } from 'vitest';
import { rmSync } from 'fs';
import { join } from 'path';
import { checkHealth, ensureSchema, query, close } from '../../lib/db.js';
@@ -145,6 +145,12 @@ describe.skipIf(!dbReady)('mood board federation (#1564)', () => {
deleted: false, deletedAt: null, ...over,
});
beforeAll(async () => { db = await import('./db.js'); });
+ beforeEach(() => {
+ rmSync(join(testState.dataRoot, 'sharing'), { recursive: true, force: true });
+ rmSync(join(testState.dataRoot, 'conflict-journal'), { recursive: true, force: true });
+ __resetBaseHashCacheForTests();
+ testState.writeCounter.baseHash = 0;
+ });
afterAll(async () => {
for (const id of created) await query(`DELETE FROM mood_boards WHERE id = $1`, [id]).catch(() => {});
await close();