From 53b815b19458539598c5464eb07d7e6963bb07ee Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Feb 2026 23:45:59 +0000 Subject: [PATCH] Reuse shared TextDecoder in ws adapter message parsing Co-authored-by: Theo Browne --- apps/renderer/src/wsNativeApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/renderer/src/wsNativeApi.ts b/apps/renderer/src/wsNativeApi.ts index e21ccde57c..714403835e 100644 --- a/apps/renderer/src/wsNativeApi.ts +++ b/apps/renderer/src/wsNativeApi.ts @@ -19,6 +19,7 @@ type PendingRequest = { type SubscriptionSet = Set<(value: TValue) => void>; const REQUEST_TIMEOUT_MS = 30_000; +const textDecoder = new TextDecoder(); class WsNativeApiClient { private socket: WebSocket | null = null; @@ -156,7 +157,7 @@ class WsNativeApiClient { } if (raw instanceof ArrayBuffer) { - return new TextDecoder().decode(raw); + return textDecoder.decode(raw); } if (raw instanceof Blob) {