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

make the TTL-cache tests fail when the cache is removed

[._.]/ Adam Eivyb64d0da79495
diff --git a/server/lib/planIds.test.js b/server/lib/planIds.test.js
index 64afb7b6e7..a7d921ef99 100644
--- a/server/lib/planIds.test.js
+++ b/server/lib/planIds.test.js
@@ -404,6 +404,12 @@ describe('planIds.js', () => {
expect(scanCount()).toBe(1);
branchesByRepo['/repo/a'] = 'main\nclaim/alpha\nclaim/gamma\n';
+
+ // Still inside the window: the new branch is deliberately NOT visible yet.
+ // Without this the test would pass against a no-cache implementation.
+ expect([...await findInProgressIds('/repo/a', KNOWN)]).toEqual(['alpha']);
+ expect(scanCount()).toBe(1);
+
now += IN_PROGRESS_SCAN_TTL_MS + 1;
const after = await findInProgressIds('/repo/a', KNOWN);
@@ -442,6 +448,11 @@ describe('planIds.js', () => {
await findInProgressIds('/repo/a', KNOWN);
expect(scanCount()).toBe(1);
+ // Establish that the cache IS live at this point — otherwise the forced
+ // call below would count a second scan against a no-cache implementation.
+ await findInProgressIds('/repo/a', KNOWN);
+ expect(scanCount()).toBe(1);
+
await findInProgressIds('/repo/a', KNOWN, { force: true });
expect(scanCount()).toBe(2);
});