fix(timeline): resync after sse reconnect
This commit is contained in:
@@ -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"]],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user