mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5718
Author: @kolacheee
Created: 9/1/2026
Status: ✅ Merged
Merged: 9/1/2026
Merged by: @kolacheee
Base:
staging← Head:fix/5657-5658-frozen-server-client📝 Commits (3)
93926e6fix(client): stop hanging forever against a frozen server (#5657, #5658, #5659)6b1a379fix(client): close the review gaps in the frozen-server handling7e14aeefix(client): unreachable overrides time-sensitive telemetry in the diagnostics copy📊 Changes
11 files changed (+321 additions, -27 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/TROUBLESHOOTING.md(+7 -1)📝
packages/client/src/App.tsx(+14 -2)📝
packages/client/src/components/chat/ChatArea.tsx(+35 -12)📝
packages/client/src/components/panels/SettingsPanel.tsx(+21 -4)📝
packages/client/src/hooks/use-chats.ts(+11 -2)📝
packages/client/src/hooks/use-connections.ts(+5 -2)📝
packages/client/src/lib/api-client.ts(+37 -0)📝
packages/client/src/lib/support-diagnostics.ts(+17 -4)📝
packages/client/src/localization/locales/en.json(+3 -0)➕
scripts/regressions/frozen-server-client-timeouts.regression.ts(+170 -0)📄 Description
Linked issue
Closes #5657, closes #5658, closes #5659.
Why this change
A frozen host — the Android/Termux cached-app-freezer state triaged in #5660 — accepts TCP connections but never answers them. Against that state the client degraded in three compounding ways: the chat-open fetch had no deadline, so "Opening chat…" spun forever and the error branch never ran (#5657);
checkVersionfired a bare/api/healthfetch on every visibility change with no in-flight guard, leaking one permanently-pending request per tab-switch until the browser's ~6-per-host connection pool saturated and dragged down even the requests that do carry timeouts (#5658); and the Support Diagnostics health query pended forever, which kept the copy button disabled with no explanation, and a settled-but-failed query rendered an indistinguishable "Unavailable" (#5657). The TROUBLESHOOTING page also misdirected Termux users to install the Termux:API add-on fortermux-wake-lockand had no entry for the freeze signature (#5659).What changed
api-client.ts: newrequestTimeoutSignal(timeoutMs, upstream?)— a hand-rolled deadline signal (deliberately notAbortSignal.any, for older WebViews) that aborts with aTimeoutErrorDOMException reason while honouring an upstream signal — andisRequestTimeoutError, a strict classifier that never mistakes React Query's own cancellation for a frozen server.useChatcomposes a 15s deadline with React Query's cancellation; a timeout is not retried (retrying only multiplies the hang) and renders an explicit "Server unreachable" state with a Termux-foregrounding hint instead of the endless spinner.AbortSignal.timeout(same primitive the keep-alive heartbeat already uses), released infinallyon every outcome.health.isPending) and the copied server field reads "Unreachable (request timed out)" so support reports carry the signal.termux-wake-lockline is corrected — the command ships in coretermux-tools, no add-on needed.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm lint, the production build, andpnpm localization:checkare green locally;format:checkfails repo-wide on this Windows checkout (pre-existing autocrlf CRLF — the touched files were run through Prettier directly).CancelledErrorcounts as cancellation, so theTimeoutErrorrejection reliably reaches the error state; the composed-signal unmount path is correctly not classified as a timeout). It confirmed six gaps, all fixed in the second commit — most notably thatuseConnections(the other leg of the copy-button gate) had no deadline and could re-create the stuck-disabled button on a cold-cache boot, and that the unreachable chat state was sticky after the server thawed (now has a Try again button, since focus-refetch is globally off).scripts/regressions/frozen-server-client-timeouts.regression.tspasses: it exercises the deadline/cancellation contract for real (timeout carries theTimeoutErrorreason; upstream abort wins and is never classified as a timeout; no lateTimeoutErroroverwrite after cancellation; strict classification) plus source pins on all four wiring sites and the locale keys.kill -STOPthe server, then (a) open a chat — after ~15s the explicit "Server unreachable" state should replace the spinner; (b) flip tab visibility several times with the network panel open — exactly one pending/api/healthat a time; (c) Settings → Advanced → Copy Support Diagnostics — button enabled after the timeout, fields read "Unreachable (request timed out)".kill -CONTrecovers.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated under [Unreleased] → Fixed.
docs/TROUBLESHOOTING.mdchanged — this rides the pending batched[docs-i18n]catch-up together with #5604 (next planned PR in this arc) rather than a per-PR mirror.UI evidence (if applicable)
The "Server unreachable" chat state and the diagnostics "Unreachable (request timed out)" line are the visible changes — screenshots worth taking during the
kill -STOPmanual pass.Summary by CodeRabbit
Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.