Reuse shared TextDecoder in ws adapter message parsing

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-09 23:45:59 +00:00
1 parent 33c3cb9a81
commit 53b815b194
1 file changed
+2 -1
+2 -1
View File
@@ -19,6 +19,7 @@ type PendingRequest = {
type SubscriptionSet<TValue> = 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) {