Skip to content

Frontend: a request without an answer no longer signs people out - #810

Merged
keysersoft merged 2 commits into
mainfrom
keysersoft/network-error-resilience
Sep 30, 2026
Merged

keysersoft merged 2 commits into
mainfrom
keysersoft/network-error-resilience

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

ANYTHINGMCP-CLOUD-FRONTEND-7 (TypeError: Load failed, Safari on a Mac): the breadcrumbs show every request failing at once at 16:56:19, the laptop's network not being there. The session check on /api/users/me treated that as a rejected token: it deleted the saved session and pushed the user to /login while offline, and 12 s later the page fell into the global error screen.

  • auth-context: only a 4xx from the backend ends the session. With no answer, or a 5xx (e.g. during a deploy), the saved session is kept and checked again on the browser's online event. A real 401 still signs out through AUTH_EXPIRED_EVENT.
  • error.tsx / global-error.tsx: network failures (Load failed, Failed to fetch, chunk load errors) say "Connection lost", are reported as warnings with network: yes, and reload the page by themselves once the connection is back (at most once per 30 s, so nothing can loop).
  • tests/e2e/network-drop.spec.ts: no answer and 502 keep the session (both fail on the old code), 401 still signs out; the error classifier. Full e2e suite: 71 passed locally.

Fixes ANYTHINGMCP-CLOUD-FRONTEND-7

A Mac woke from sleep before its network was back; the session check failed
with Safari's 'Load failed' and the app deleted the saved session and sent
the user to /login, offline, where the page fell into the global error
screen. Only a 4xx from the backend now ends the session; on no answer or a
5xx the session is kept and re-checked when the browser is back online.

The error boundaries recognise network failures, report them as warnings and
reload the page by themselves once the connection returns.

Fixes ANYTHINGMCP-CLOUD-FRONTEND-7
@keysersoft
keysersoft enabled auto-merge (squash) September 30, 2026 20:44
@keysersoft
keysersoft merged commit 4664ee5 into main Sep 30, 2026
13 checks passed
@keysersoft
keysersoft deleted the keysersoft/network-error-resilience branch September 30, 2026 20:47
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant