mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-15 12:10:19 +00:00
8eadfb048f
On 401, api() redirects to /login and returns undefined. The browser navigates away immediately, so this code rarely runs. But even if it did, clearing localStorage on transient auth expiry is wrong — it wipes the saved session id and sends users to empty state after re-login. Keep the self-heal in the catch-block else branch for non-401, non-404 errors (400/403/500/network) which genuinely trap the user on recurring boot failures. 401 has no such property because the redirect already breaks the retry loop. Greptile: 'Keep the if (!data) early-return clearing-free (its old behavior), and only call _clearStuckSessionOnBoot() from the else branch of the catch.' (#4028 follow-up)