fix(core): allow scheduler jitter in update-check and telemetry throttles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Sonnet 5.5 committed 2026-10-04 17:17:18 -04:00
1 parent 98fd236b5c
commit 57aaa5e7d2
4 files changed
+69 -4

No files matched your search

+13
View File
@@ -91,6 +91,19 @@ describe("performTelemetryReport", () => {
expect(globalThis.fetch).toHaveBeenCalledOnce();
});
test("reports on the next daily run despite last run's latency", async () => {
setSetting("telemetryEnabled", "true");
const lastReported = new Date(TEST_NOW.getTime() - (24 * 60 * 60 * 1000 - 30_000));
setSetting("telemetryLastReportedAt", lastReported.toISOString());
vi.spyOn(globalThis, "fetch").mockImplementation(
(async () => new Response(null, { status: 200 })) as unknown as typeof fetch,
);
await performTelemetryReport();
expect(globalThis.fetch).toHaveBeenCalledOnce();
});
test("does not throw on fetch failure", async () => {
setSetting("telemetryEnabled", "true");