fix(timeline): resync after sse reconnect

This commit is contained in:
2026-04-01 15:04:00 +02:00
parent d4652b7a42
commit 3258b59e21
5 changed files with 94 additions and 2 deletions
+24 -1
View File
@@ -1,6 +1,10 @@
import { SSE_EVENT_TYPES } from "@capakraken/shared";
import { describe, expect, it } from "vitest";
import { getTimelineSseInvalidationKeys, parseTimelineSseEvent } from "./timelineSsePolicy.js";
import {
getTimelineSseInvalidationKeys,
getTimelineSseResyncKeys,
parseTimelineSseEvent,
} from "./timelineSsePolicy.js";
describe("timelineSsePolicy", () => {
it("returns null for malformed event payloads", () => {
@@ -33,4 +37,23 @@ describe("timelineSsePolicy", () => {
[["notification", "unreadCount"]],
]);
});
it("returns the full resync invalidation set for reconnect catch-up", () => {
expect(getTimelineSseResyncKeys()).toEqual([
[["timeline", "getEntries"]],
[["timeline", "getEntriesView"]],
[["timeline", "getMyEntriesView"]],
[["timeline", "getHolidayOverlays"]],
[["timeline", "getMyHolidayOverlays"]],
[["vacation", "list"]],
[["allocation", "list"]],
[["project", "list"]],
[["timeline", "getBudgetStatus"]],
[["notification", "listTasks"]],
[["notification", "taskCounts"]],
[["notification", "list"]],
[["notification", "unreadCount"]],
[["notification", "listReminders"]],
]);
});
});