Skip to content

fix(connection): say which server failed, and what ran out - #528

Merged
EVWorth merged 1 commit into
mainfrom
fix/connection-opaque-failures
Aug 30, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/connection-opaque-failures

Conversation

@EVWorth

@EVWorth EVWorth commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Refs #276, #279. Both are one fault wearing two hats: the app knew something had gone wrong and didn't pass it on.

Silent startup reconnect (#276)

Auto-reconnect ended in catch {}:

} catch {
  // Server may be unreachable — leave tab without a live connection
}

Leaving the tab without a connection is right. Saying nothing isn't — the tab looked entirely normal, and the user found out at the next query via Connection not found, which names neither the server nor when it happened. Failures are now collected and reported by name, with what to do about it.

Opaque pool exhaustion (#279)

sqlx reports pool timed out while waiting for an open connection. True and useless: it names neither the pool, the limit that was hit, nor anything the user could change.

The message now names the profile, its max pool size, how long it waited, and the two things that actually cause it — something long-running holding the connections, or a limit too low for how the connection is used. Applied at connect and at query time, since the second is where it will usually bite.

Only the pool-timeout case is rewritten. Every other driver error keeps its own message, which is nearly always more specific than anything we'd substitute — there's a test pinning that.

What this deliberately does not do

Neither issue is fully closed:

Both are features rather than defects, so they're left for the feature pass. I'll note that on the issues rather than closing them.

Verification

The reconnect test was run against the unfixed code and fails there.

While fixing ConnectionTabs.test.tsx I found its store mock had no setState/getState, so the component's calls hit the real store — a continuation of the wrong-mock-path problem from #526. The mock now provides both.

1657 frontend tests, 79 unit, 63 integration. clippy/tsc/dprint clean.

Unrelated: the test containers had stopped (host restart), which briefly showed as 6 integration failures. just db-up and they're green — which is the #[ignore] split from #516 working as intended.

🤖 Generated with Claude Code

Both of these are one fault wearing two hats: the app knew something had gone
wrong and did not pass it on.

Auto-reconnect at startup ended in `catch {}`. A server that was down left its
tabs looking entirely normal, and the user found out at the next query, via
"Connection not found" — which names neither the server nor the moment it
happened. The failures are now collected and reported by name, with what to do
about it. Leaving the tab without a live connection was already the right
behaviour and is unchanged.

Pool exhaustion surfaced as sqlx's "pool timed out while waiting for an open
connection". That is true and useless: it names neither the pool, nor the
limit that was hit, nor anything the user could change. The message now names
the profile, its max pool size, how long it waited, and the two things that
actually cause it — something long-running holding the connections, or a
limit set too low for how the connection is used. Applied both at connect and
at query time, since the second is where it will usually bite.

Only the pool-timeout case is rewritten; every other driver error keeps its
own message, which is nearly always more specific than anything we could
substitute.

Neither issue is fully closed by this, and deliberately so. #276 also asks for
a HealthChecker that notices a server going away and reconnects on a backoff,
and #279 for live pool statistics in the status bar. Both are features rather
than defects, and are left for the feature pass.

Refs #276, #279
@EVWorth
EVWorth merged commit bccae3c into main Aug 30, 2026
9 checks passed
@EVWorth
EVWorth deleted the fix/connection-opaque-failures branch August 30, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant