🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Stop in-flight warranty load when the user logs out
Omega (QA)3cf5c8e87afe
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b70b899..e5dc3b7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,8 @@- _Files: `backend/oidc_handler.py`, `tests/test_oidc_pkce.py`_- **Dependency updates: Authlib 1.9.5 and Apprise 2.2.0 (#291, #256):** Authlib moves from 1.9.2 to 1.9.5, three upstream security releases: 1.9.3 refuses form_post responses to non-http(s) redirect URIs in the implicit and hybrid grants, 1.9.4 fixes ID-JAG user resolution for multi-tenant providers, and 1.9.5 completes the fix for CVE-2026-114615 by refusing public keys and certificates as HMAC secrets. Warracker uses Authlib as an OIDC client rather than an authorization server, so these are taken as auth-stack hygiene alongside the new PKCE support. Apprise moves from 1.13.1 to 2.2.0, a major release carrying the upstream security fix GHSA-cfp4-m43r-v9q4 and a dozen new notification services. Behavior changes in Apprise 2 that touch notifications: `notify()` returns a detailed result object instead of True/False/None, deliveries to multiple targets run in parallel by default, and retries are tracked per target. Warracker reads the result the same way it always has, sent only when every target was delivered to, and the handler now coerces the result to a plain bool, so test, custom, and expiration notifications behave identically for callers. The deprecated Apprise options removed in 2.0 were not in use.- _Files: `backend/requirements.txt`, `backend/apprise_handler.py`, `tests/test_apprise_notify_result.py`_+- **Stray 401 after logout, fixed:** the dashboard loads warranties in two requests, the main list and then the archived list merged into the All view. If logout happened while the first request was in flight, the second request went out after the token was cleared and drew a 401. No error was visible to the user, only a stray failed request in the network log. The list loader now re-checks authentication after the first request resolves and stops instead of fetching or rendering for a logged-out user.+ - _Files: `frontend/js/controllers/warrantyListController.js`_- **Status page detail now honors global view:** with global view on, a plain user could see another user's warranty row on the status page but expanding it failed, because the detail endpoint restricted non-admins to their own warranties and ignored the global view setting, so no detail panel or Edit button appeared. The endpoint now follows the same rule as the warranty list: with global view enabled and not restricted to admins, any authenticated user may view any warranty. With global view off, or restricted to admins, non-owners are still turned away as before. Editing another user's warranty remains owner and admin only.- _Files: `backend/warranties_routes.py`, `tests/test_debug_warranty_global_view.py`_diff --git a/frontend/js/controllers/warrantyListController.js b/frontend/js/controllers/warrantyListController.jsindex e58d4db..22d20f9 100644--- a/frontend/js/controllers/warrantyListController.js+++ b/frontend/js/controllers/warrantyListController.js@@ -163,6 +163,15 @@ export async function loadWarranties(isAuthenticatedOverride) {updateWarrantiesPanelTitle(scope === 'global');const primary = await listWarranties({ scope, archived: filters.status === 'archived' });++ // The user may have logged out while the primary fetch was in flight.+ // The token is read fresh on every request, so the follow-up archived+ // fetch below would go out without credentials and draw a stray 401.+ // Stop here instead of fetching or rendering for a logged-out user.+ if (!authService.isAuthenticated()) {+ return;+ }+let combined = Array.isArray(primary) ? primary : [];let lastLoadedArchived = filters.status === 'archived';