fix(data-grid): show timeout actions on table data errors

This commit is contained in:
zipg authored and GitHub committed 2026-07-08 23:44:50 +08:00
1 parent 313ae2d071
commit b862870e8e
4 files changed
+39 -12

No files matched your search

@@ -23,6 +23,7 @@ describe("isQueryTimeoutErrorMessage", () => {
it("detects agent RPC client-side timeout", () => {
expect(isQueryTimeoutErrorMessage("Agent RPC call timed out (30s)")).toBe(true);
expect(isQueryTimeoutErrorMessage("Agent RPC call timed out (120s)")).toBe(true);
expect(isQueryTimeoutErrorMessage("Agent RPC error (-1): Agent RPC call timed out (120s)")).toBe(true);
});
it("does not classify unrelated errors as query timeouts", () => {
+1 -1
View File
@@ -5,7 +5,7 @@ export function isQueryTimeoutErrorMessage(message: string): boolean {
// fallback when JDBC setQueryTimeout never fires (unsupported/unresponsive driver), so the
// backend already treats it as a query timeout (is_agent_rpc_timeout_error in query.rs) —
// surface the same action here to stay consistent with the backend.
if (lower.startsWith("agent rpc call timed out")) return true;
if (/\bagent rpc call timed out\b/.test(lower)) return true;
if (/\b(?:canceling|cancelling|canceled|cancelled)\b[\s\S]{0,80}\bstatement\b[\s\S]{0,80}\btimeout\b/.test(lower)) return true;
if (/\b(?:connection|connect|pool|checkout|metadata|loading|health check|cancel request|ssh|tunnel)\b/.test(lower)) return false;
return (