Gateway: keep finished threads in Recent until settled, with a full list and settle-all route
Gateway / check (push) Successful in 9s
Gateway / image (push) Successful in 23s

This commit is contained in:
gib committed 2026-11-01 22:26:41 -05:00
1 parent cf8995e63f
commit 2a127327bf
5 files changed
+110 -26

No files matched your search

+10 -3
View File
@@ -140,7 +140,6 @@ describe("routeKind", () => {
});
describe("buildFeed", () => {
const now = Date.parse("2026-11-01T09:30:00.000Z");
const host = (label: string, threads: ThreadShell[]) =>
({
id: label,
@@ -164,7 +163,6 @@ describe("buildFeed", () => {
]),
],
new SummaryCache(),
now,
);
expect(feed.working).toEqual([]);
expect(feed.needsYou.map((item) => [item.threadId, item.phase, item.via])).toEqual([
@@ -182,11 +180,20 @@ describe("buildFeed", () => {
]),
],
new SummaryCache(),
now,
);
expect(feed.needsYou.map((item) => [item.threadId, item.via?.threadId ?? null])).toEqual([
["parent", "first"],
["later", null],
]);
});
it("keeps finished threads in Recent until they are settled, however old", async () => {
const old = (id: string, day: number) => thread({ id, status: "completed", updatedAt: `2026-10-${day}T09:00:00.000Z` });
const feed = await buildFeed(
[host("Desktop", [...Array.from({ length: 11 }, (_, i) => old(`t${i}`, 10 + i)), { ...old("done", 29), settledOverride: "settled" }])],
new SummaryCache(),
);
expect(feed.recent.map((item) => item.threadId)).toEqual(["t10", "t9", "t8", "t7", "t6", "t5", "t4", "t3", "t2", "t1"]);
expect(feed.recentTotal).toBe(11);
});
});