fix(status): show a strip when the homeserver hangs, not 110 s later (#317) #380

Merged
jared merged 1 commits from fix/stall-watchdog into lotus 2026-10-17 21:58:24 -04:00
Owner

Fixes #317.

When the homeserver hangs (it accepts connections but never answers, like the out-of-memory stall on 2026-09-29), sync stays SYNCING for up to 110 s: the 30 s pollTimeout plus the SDK's 80 s buffer. So no strip showed, and Kuma was never asked early.

Change

  • New useHomeserverStall watchdog. It checks every 10 s; if /sync is more than 45 s overdue, it probes GET /_matrix/client/versions with a 5 s timeout.
  • No answer → a Warning strip: "Lotus Chat's server isn't responding. Messages will send when it's back. Still trying…". The strip takes priority over "Connecting…".
  • ServerStatusFeature treats a stall like a lost sync, so Kuma is polled straight away and the "server is down" banner can take over.
  • The next sync clears it.

Verified by freezing the local Synapse with SIGSTOP for 90 s:

  • Before: no strip at any point in the 90 s.
  • After: the strip appears at 50 s and is gone 15 s after SIGCONT.

Unit test for the overdue rule. tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #317. When the homeserver hangs (it accepts connections but never answers, like the out-of-memory stall on 2026-09-29), sync stays `SYNCING` for up to **110 s**: the 30 s `pollTimeout` plus the SDK's 80 s buffer. So no strip showed, and Kuma was never asked early. **Change** - New `useHomeserverStall` watchdog. It checks every 10 s; if `/sync` is more than 45 s overdue, it probes `GET /_matrix/client/versions` with a 5 s timeout. - No answer → a Warning strip: "Lotus Chat's server isn't responding. Messages will send when it's back. Still trying…". The strip takes priority over "Connecting…". - `ServerStatusFeature` treats a stall like a lost sync, so Kuma is polled straight away and the "server is down" banner can take over. - The next sync clears it. **Verified** by freezing the local Synapse with `SIGSTOP` for 90 s: - **Before:** no strip at any point in the 90 s. - **After:** the strip appears at **50 s** and is gone 15 s after `SIGCONT`. Unit test for the overdue rule. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-17 19:29:05 -04:00
fix(status): show a strip when the homeserver hangs, not 110 s later (#317)
CI / Build & Quality Checks (pull_request) Successful in 2m40s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 8s
CI / Playwright smoke (e2e) (pull_request) Successful in 17m50s
e8fd0a1112
A hung Synapse (accepts connections, never answers) kept sync SYNCING
for up to 110 s (pollTimeout 30 s + the SDK's 80 s buffer), so no strip
showed and Kuma was never asked. A watchdog now notices a /sync overdue
by 45 s, confirms with a 5 s GET /_matrix/client/versions, then shows
"Lotus Chat's server isn't responding…" and polls Kuma at once.

Fixes #317

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit dd6cf156ba into lotus 2026-10-17 21:58:24 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#380