Boot-failure seatbelt: no future crash becomes a silent white screen
Per Codex. A branded recovery card in app.html shows if the app hasn't mounted in 7s, or on a pre-mount JS error/unhandledrejection — with a "Refresh Upbeat Bytes" button. A chunk/preload failure (vite:preloadError) reloads once (sessionStorage-guarded). +layout calls window.__ubBooted() on mount to clear the card + timer. A pre-mount failure also fires a tiny anonymous client_error beacon; the admin Overview now shows "Load errors today" (red if >0) so we can see if blank-risk is happening in the wild. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -444,6 +444,7 @@ _EVENT_KINDS = {
|
||||
"share_ub", "copy_source", "native_share",
|
||||
"not_today", "less_like_this", "hide_topic",
|
||||
"replace_used", "replace_none", "paywall_replace", "paywalled_source_open",
|
||||
"client_error", # boot-failure seatbelt beacon (blank-screen risk signal)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -565,6 +565,11 @@ def admin_stats(conn: sqlite3.Connection, days: int = 30) -> dict:
|
||||
"top_topics": top_topics,
|
||||
"shares": shares,
|
||||
"daily": daily,
|
||||
# Boot-failure seatbelt signal — blank-screen risk surfacing.
|
||||
"client_errors": {
|
||||
"today": scalar("SELECT COUNT(*) FROM events WHERE kind='client_error' AND day=date('now')"),
|
||||
"window": kc.get("client_error", 0),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user