From 32d95f20be6316146ec9481f36eef16722101bbe Mon Sep 17 00:00:00 2001 From: masad-frost Date: Tue, 3 Sep 2024 15:32:40 -0700 Subject: [PATCH 1/3] Add a special logging tag to uncaught handler exceptions --- logging/log.ts | 5 +++-- router/server.ts | 2 ++ transport/impls/ws/connection.ts | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/logging/log.ts b/logging/log.ts index b2f5f8d3..77ad7c86 100644 --- a/logging/log.ts +++ b/logging/log.ts @@ -22,7 +22,8 @@ export type Tags = | 'invariant-violation' | 'state-transition' | 'invalid-request' - | 'unhealthy-session'; + | 'unhealthy-session' + | 'uncaught-handler-error'; const cleanedLogFn = (log: LogFn) => { return (msg: string, metadata?: MessageMetadata) => { @@ -53,7 +54,7 @@ export type MessageMetadata = Partial<{ traceId: string; spanId: string; }; - extras: unknown; + extras?: Record; }>; export class BaseLogger implements Logger { diff --git a/router/server.ts b/router/server.ts index 15d7bfed..a4df77f5 100644 --- a/router/server.ts +++ b/router/server.ts @@ -515,7 +515,9 @@ class RiverServer }, extras: { error: errorMsg, + originalException: err, }, + tags: ['uncaught-handler-error'], }, ); diff --git a/transport/impls/ws/connection.ts b/transport/impls/ws/connection.ts index 6a82149a..8ca1d353 100644 --- a/transport/impls/ws/connection.ts +++ b/transport/impls/ws/connection.ts @@ -1,8 +1,8 @@ import { Connection } from '../../connection'; import { WsLike } from './wslike'; -interface ConnectionInfoExtras { - headers: Record; +interface ConnectionInfoExtras extends Record { + headers: Record; } const WS_HEALTHY_CLOSE_CODE = 1000; From d45fefb62843b80287568fe1394a842dc6d3b411 Mon Sep 17 00:00:00 2001 From: masad-frost Date: Tue, 3 Sep 2024 15:57:37 -0700 Subject: [PATCH 2/3] string string string --- transport/impls/ws/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/impls/ws/connection.ts b/transport/impls/ws/connection.ts index 8ca1d353..f7a1cbe8 100644 --- a/transport/impls/ws/connection.ts +++ b/transport/impls/ws/connection.ts @@ -2,7 +2,7 @@ import { Connection } from '../../connection'; import { WsLike } from './wslike'; interface ConnectionInfoExtras extends Record { - headers: Record; + headers: Record; } const WS_HEALTHY_CLOSE_CODE = 1000; From 1b8dc477dcc2dfa36827d2e91ce47185c18739c6 Mon Sep 17 00:00:00 2001 From: masad-frost Date: Tue, 3 Sep 2024 15:58:02 -0700 Subject: [PATCH 3/3] 0.200.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fbbec3f9..89861420 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@replit/river", - "version": "0.200.3", + "version": "0.200.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@replit/river", - "version": "0.200.3", + "version": "0.200.4", "license": "MIT", "dependencies": { "@msgpack/msgpack": "^3.0.0-beta2", diff --git a/package.json b/package.json index 8802fa1d..9e874b3c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@replit/river", "description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!", - "version": "0.200.3", + "version": "0.200.4", "type": "module", "exports": { ".": {