From 7aef4171afe7f052c60093cf6fb1f56db8afcebc Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 17:51:10 +0100 Subject: [PATCH] Preserve native sessions during temporary server outages --- docs/architecture.md | 11 ++++++++++ src/App.svelte | 42 ++++++++++++++++++++++++++++++------ src/session-recovery.js | 14 ++++++++++++ src/session-recovery.test.js | 17 +++++++++++++++ tsconfig.json | 1 + 5 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 src/session-recovery.js create mode 100644 src/session-recovery.test.js diff --git a/docs/architecture.md b/docs/architecture.md index 5bd78d3..8c583a0 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -9,3 +9,14 @@ calls Twitch directly, executes plugin code, or treats local UI state as authoritative. Local overlay drafts and display preferences are recoverable presentation data only; the server remains authoritative for publication, authorization, Twitch state, and durable history. + +# Saved-session recovery + +Native startup verifies the keyring session before loading authenticated data. +HTTP 401/403 clears the saved session and requests login. Server failures retain +the credential and retry immediately, then after 3, 10, 15, and repeatedly 30 +seconds. Manual login and logout cancel pending restoration. Dashboard-loading +failures do not invalidate a successfully verified session. + +Run `node --test src/session-recovery.test.js` for response classification and +retry-schedule coverage. This is not a substitute for native AppImage acceptance. diff --git a/src/App.svelte b/src/App.svelte index 9a44b53..e975ea3 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,6 +1,11 @@