From 09a30103e923b7dba32a5e12ead4006b09475aa7 Mon Sep 17 00:00:00 2001 From: Phat Pham Date: Tue, 23 Jun 2026 19:21:24 +0700 Subject: [PATCH] feat: prompt to refresh when a new version is deployed An installed PWA reopened from the iOS/iPadOS home screen resumes a frozen page rather than re-running the bootstrap script, so it never notices a deploy that happened while backgrounded. Adds a cheap GET /api/version (uncached, always reflects the live APP_VERSION) that the client polls on visibilitychange/pageshow/focus-equivalent resume and on a 15-minute foreground interval; on a mismatch it shows a "Refresh" banner instead of silently staying stale. Co-Authored-By: Claude Sonnet 4.6 --- core/render.ts | 6 +++- platforms/cloudflare/src/index.ts | 19 +++++++++++- web-static/static/app.js | 50 ++++++++++++++++++++++++++++++- web-static/static/style.css | 30 +++++++++++++++++++ 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/core/render.ts b/core/render.ts index 4e3f5a0..25ce27c 100644 --- a/core/render.ts +++ b/core/render.ts @@ -154,9 +154,13 @@ export function renderIndexPage(data: PageData): string { - +