mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(integrations): give Oura and WHOOP a 48 h silence window
Their rings and straps upload only when the phone app is opened, so a day without opening it is ordinary and must not page the operator. Wearables whose cloud receives data on its own keep 24 h, Apple Health keeps 48 h, and scales, cuffs and Strava never alert on silence.
This commit is contained in:
1 parent
a4942e631f
commit
8ebc6fe546
3 files changed
+79
-20
No files matched your search
@@ -96,12 +96,13 @@ beforeEach(async () => {
|
||||
|
||||
describe("integration watchdog", () => {
|
||||
it("flags a normally-daily wearable gone silent, alerts once, then sends one recovery note", async () => {
|
||||
// Fourteen consecutive days of data before the window, newest 30 h ago.
|
||||
// Thirteen consecutive days of data before the window, newest 54 h ago:
|
||||
// past Oura's 48 h window (it uploads only when its phone app is opened).
|
||||
await seedDailyReadings(
|
||||
USER,
|
||||
"OURA",
|
||||
Array.from({ length: 13 }, (_, i) => i + 2),
|
||||
30,
|
||||
Array.from({ length: 13 }, (_, i) => i + 3),
|
||||
54,
|
||||
);
|
||||
vi.useFakeTimers({ toFake: ["Date"] });
|
||||
vi.setSystemTime(NOW);
|
||||
@@ -170,7 +171,7 @@ describe("integration watchdog", () => {
|
||||
});
|
||||
|
||||
it("leaves a wearable alone when its owner wears it only now and then", async () => {
|
||||
await seedDailyReadings(USER, "OURA", [3, 7, 11], 30);
|
||||
await seedDailyReadings(USER, "OURA", [3, 7, 11], 54);
|
||||
await recordSyncSuccess(USER, "oura");
|
||||
const summary = await runIntegrationWatchdog({ mode: "hourly", now: NOW });
|
||||
expect(summary.silencesFlagged).toBe(0);
|
||||
|
||||
Reference in new issue
Block a user