mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-10-16 06:25:42 -04:00
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:
4 files changed
+69
-4
No files matched your search
@@ -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");
|
||||
|
||||
|
||||
Reference in new issue
Block a user