Skip to content

Commit dbd6395

Browse files
committed
fix: update transport error pattern to match RPC method-suffixed messages
The regex /\bis not connected\.$/ no longer matches EnvironmentRpcUnavailableError messages that include the RPC method (e.g. 'Test environment is not connected for RPC method sendMessage.'). Change the pattern to /\bis not connected\b/ so it matches regardless of trailing content, ensuring mobile outbox retry logic and web error sanitization continue to classify these as transport errors.
1 parent c840111 commit dbd6395

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/client-runtime/src/errors/transport.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ describe("isTransportConnectionErrorMessage", () => {
2727
),
2828
).toBe(true);
2929
expect(isTransportConnectionErrorMessage("Test environment is not connected.")).toBe(true);
30+
expect(
31+
isTransportConnectionErrorMessage(
32+
"Test environment is not connected for RPC method sendMessage.",
33+
),
34+
).toBe(true);
3035
expect(isTransportConnectionErrorMessage("ClientProtocolError: socket closed")).toBe(true);
3136
});
3237

packages/client-runtime/src/errors/transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const TRANSPORT_ERROR_PATTERNS = [
33
/\bSocketOpenError\b/i,
44
/\bSocket is not connected\b/i,
55
/Unable to connect to the T3 server WebSocket\./i,
6-
/\bis not connected\.$/i,
6+
/\bis not connected\b/i,
77
/\bdisconnected\.$/i,
88
/\bcould not establish a WebSocket connection\.$/i,
99
/\bClientProtocolError\b/i,

0 commit comments

Comments
 (0)