perf(sync): reduce timeline catch-up page size

This commit is contained in:
Mohamed Boudra
2026-07-21 13:44:23 +02:00
parent aa6384babd
commit f214261ae5
2 changed files with 6 additions and 6 deletions
@@ -1,3 +1,3 @@
// Count is projected timeline items, not delta chunks. Fetch responses never return
// tool lifecycle deltas; `sourceSeqRanges` maps projected items back to source seqs.
export const TIMELINE_FETCH_PAGE_SIZE = 100;
export const TIMELINE_FETCH_PAGE_SIZE = 40;
@@ -183,7 +183,7 @@ test("uses a tail fetch when a live cursor is not authoritative", async () => {
membership.succeed();
const fetch = await world.nextFetch("agent-a");
expect(fetch.request).toEqual({ direction: "tail", limit: 100, projection: "projected" });
expect(fetch.request).toEqual({ direction: "tail", limit: 40, projection: "projected" });
fetch.respond({ hasNewer: false });
});
@@ -209,7 +209,7 @@ test("unchanged visible-set publication does not cancel paged catch-up", async (
expect(secondPage.request).toEqual({
direction: "after",
cursor: { epoch: "epoch-agent-a", seq: 5 },
limit: 100,
limit: 40,
projection: "projected",
});
world.expectNoPendingMembership();
@@ -371,13 +371,13 @@ test("gap recovery supersedes completed catch-up and pages through the current t
{
direction: "after",
cursor: { epoch: "epoch-agent-a", seq: 10 },
limit: 100,
limit: 40,
projection: "projected",
},
{
direction: "after",
cursor: { epoch: "epoch-agent-a", seq: 15 },
limit: 100,
limit: 40,
projection: "projected",
},
]);
@@ -660,7 +660,7 @@ test("legacy delivery skips subscription RPCs while retaining visibility catch-u
expect(recovery.request).toEqual({
direction: "after",
cursor: { epoch: "epoch-agent-a", seq: 10 },
limit: 100,
limit: 40,
projection: "projected",
});
});