Reduce log ingest and SCUM page refresh pressure
This commit is contained in:
@@ -116,6 +116,14 @@ describe("SCUM plugin feature module", () => {
|
||||
expect(dataClientSource).not.toContain("logs.query");
|
||||
});
|
||||
|
||||
it("does not block page data reads on SCUM database refresh dispatch", async () => {
|
||||
const releaseDispatches: Array<(value: { status: "queued" }) => void> = [];
|
||||
const dispatch = vi.fn<NonNullable<SCUMWorkspaceActions["dispatch"]>>(() => new Promise((resolve) => { releaseDispatches.push(resolve); }));
|
||||
const list = vi.fn(async (collection: string) => ({ items: [{ key: `${collection}-1`, value: { collection } }], count: 1 }));
|
||||
await expect(loadSCUMSurface({ pluginData: pluginDataActions({ list }), dispatch }, "live-map")).resolves.toMatchObject({ players: expect.any(Array), vehicles: expect.any(Array) });
|
||||
releaseDispatches.forEach((release) => release({ status: "queued" }));
|
||||
});
|
||||
|
||||
it("uses workflows as the manifest activity key and keeps activity as a compatibility alias", async () => {
|
||||
const list = vi.fn(async (collection: string) => ({ items: [{ key: `${collection}-1`, value: { collection } }], count: 1 }));
|
||||
await loadSCUMSurface({ pluginData: pluginDataActions({ list }) }, "workflows");
|
||||
@@ -308,7 +316,8 @@ describe("SCUM plugin feature module", () => {
|
||||
expect(source).not.toContain("projectSCUMLoginLogs");
|
||||
expect(source).not.toContain("logs.query");
|
||||
expect(source).not.toContain("requestSCUMPageQueries");
|
||||
expect(pageSource).toContain("setInterval(refresh, 5000)");
|
||||
expect(pageSource).toContain("scumSurfaceRefreshMs = 15000");
|
||||
expect(pageSource).toContain("setInterval(refresh, scumSurfaceRefreshMs)");
|
||||
expect(pageSource).toContain("clearInterval(interval)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user