feat(store): persist garmin_connected_at, set once on first successful auth

This commit is contained in:
2026-07-26 12:21:42 +02:00
parent d1d2d612a5
commit 6a3f0201af
5 changed files with 103 additions and 5 deletions

View File

@@ -35,6 +35,12 @@ CREATE TABLE profile (
name TEXT NOT NULL DEFAULT 'Default',
garmin_email TEXT NOT NULL DEFAULT '',
garmin_password TEXT NOT NULL DEFAULT '',
-- Set once, the first time this user successfully authenticates with
-- Garmin (handleAuthLogin/handleAuthMFA). Null means never connected --
-- the login gate uses this (not the in-memory auth status, which
-- resets on restart) to decide whether a returning user must
-- reconnect before entering the app.
garmin_connected_at TEXT,
rolling_window_days INTEGER NOT NULL DEFAULT 90,
-- BackfillHorizonDays bounds how far back "Sync now" reaches when
-- walking backward from today; read fresh on every sync (not cached at