From f3c1d09521f71d7567435b90a21786521def5648 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Fri, 17 Jul 2026 09:44:12 +0000 Subject: [PATCH] promote: daily cookie-session keep-alive (the "refresh every 24h" for cookie auth) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cookie-auth accounts have no OAuth refresh token to exchange, so a literal token-refresh job has nothing to call. The cookie equivalent: once a day reload each active cookie account with its stored cookies and re-save the rotated (sliding-expiry) cookies the site issues, which extends the session and staves off premature token_expired. Also proactively flags a session that HAS died so the user is prompted to reconnect before a scheduled post fails. - migration: sp_account.session_refreshed_at (gates the 24h cadence across worker restarts + surfaces "last kept alive" in the UI) - lib/sp/platforms/browser.ts: refreshCookieSession() — loads the home URL, checks login, returns the context's refreshed cookies - lib/sp/sessionRefresh.ts: refreshCookieSessions() sweep — per-platform home URLs, re-encrypts refreshed cookies, flags dead sessions token_expired; never flags on a transient/navigation error - worker/index.ts: run at startup + every 24h (23h per-account gate) - promote/accounts: shows "Session kept alive