Skip to content

Commit 6a5dc70

Browse files
Robclaude
andcommitted
fix(telegram): increase default refresh window from 5 to 15 minutes
The 5-minute default matched the CGM read interval exactly, so any timing jitter or processing delay caused the second reading to miss the window and post a fresh message instead of editing the bubble. 15 minutes aligns the window with the missed-reading threshold: readings that arrive before the missed alert always edit in-place; only after 15+ minutes of silence does the next reading start a fresh bubble. Migrate any existing stored value of 5 on load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7e2d629 commit 6a5dc70

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Common/src/main/java/tk/glucodata/OutboundApiSettings.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object OutboundApiSettings {
5050
const val DEFAULT_TRIGGER_LOW_MGDL = 70
5151
const val DEFAULT_TRIGGER_HIGH_MGDL = 180
5252
const val DEFAULT_REFRESH_IN_PLACE_ENABLED = true
53-
const val DEFAULT_REFRESH_WINDOW_MINUTES = 5
53+
const val DEFAULT_REFRESH_WINDOW_MINUTES = 15
5454
const val DEFAULT_SUPPRESS_DELTA_BELOW_MGDL = 1
5555
const val DEFAULT_STALE_ENABLED = true
5656
const val DEFAULT_STALE_THRESHOLD_MINUTES = 10
@@ -604,7 +604,10 @@ object OutboundApiSettings {
604604
refreshWindowMinutes = item.optInt(
605605
"refreshWindowMinutes",
606606
DEFAULT_REFRESH_WINDOW_MINUTES
607-
).coerceIn(1, 60),
607+
).let { stored ->
608+
// Migrate the old 5-minute default: too tight for a 5-min CGM interval.
609+
if (stored == 5) DEFAULT_REFRESH_WINDOW_MINUTES else stored
610+
}.coerceIn(1, 60),
608611
suppressDeltaBelowMgdl = item.optInt(
609612
"suppressDeltaBelowMgdl",
610613
DEFAULT_SUPPRESS_DELTA_BELOW_MGDL

0 commit comments

Comments
 (0)