fix: remove dead backpressure code left over from terminal stream fix
This commit is contained in:
@@ -405,7 +405,6 @@ export type SessionOptions = {
|
|||||||
appVersion: string | null;
|
appVersion: string | null;
|
||||||
onMessage: (msg: SessionOutboundMessage) => void;
|
onMessage: (msg: SessionOutboundMessage) => void;
|
||||||
onBinaryMessage?: (frame: Uint8Array) => void;
|
onBinaryMessage?: (frame: Uint8Array) => void;
|
||||||
getBinaryBufferedAmount?: () => number;
|
|
||||||
onLifecycleIntent?: (intent: SessionLifecycleIntent) => void;
|
onLifecycleIntent?: (intent: SessionLifecycleIntent) => void;
|
||||||
logger: pino.Logger;
|
logger: pino.Logger;
|
||||||
downloadTokenStore: DownloadTokenStore;
|
downloadTokenStore: DownloadTokenStore;
|
||||||
@@ -560,7 +559,6 @@ export class Session {
|
|||||||
private readonly sessionId: string;
|
private readonly sessionId: string;
|
||||||
private readonly onMessage: (msg: SessionOutboundMessage) => void;
|
private readonly onMessage: (msg: SessionOutboundMessage) => void;
|
||||||
private readonly onBinaryMessage: ((frame: Uint8Array) => void) | null;
|
private readonly onBinaryMessage: ((frame: Uint8Array) => void) | null;
|
||||||
private readonly getBinaryBufferedAmount: (() => number) | null;
|
|
||||||
private readonly onLifecycleIntent: ((intent: SessionLifecycleIntent) => void) | null;
|
private readonly onLifecycleIntent: ((intent: SessionLifecycleIntent) => void) | null;
|
||||||
private readonly sessionLogger: pino.Logger;
|
private readonly sessionLogger: pino.Logger;
|
||||||
private readonly paseoHome: string;
|
private readonly paseoHome: string;
|
||||||
@@ -659,7 +657,6 @@ export class Session {
|
|||||||
appVersion,
|
appVersion,
|
||||||
onMessage,
|
onMessage,
|
||||||
onBinaryMessage,
|
onBinaryMessage,
|
||||||
getBinaryBufferedAmount,
|
|
||||||
onLifecycleIntent,
|
onLifecycleIntent,
|
||||||
logger,
|
logger,
|
||||||
downloadTokenStore,
|
downloadTokenStore,
|
||||||
@@ -689,7 +686,6 @@ export class Session {
|
|||||||
this.sessionId = uuidv4();
|
this.sessionId = uuidv4();
|
||||||
this.onMessage = onMessage;
|
this.onMessage = onMessage;
|
||||||
this.onBinaryMessage = onBinaryMessage ?? null;
|
this.onBinaryMessage = onBinaryMessage ?? null;
|
||||||
this.getBinaryBufferedAmount = getBinaryBufferedAmount ?? null;
|
|
||||||
this.onLifecycleIntent = onLifecycleIntent ?? null;
|
this.onLifecycleIntent = onLifecycleIntent ?? null;
|
||||||
this.downloadTokenStore = downloadTokenStore;
|
this.downloadTokenStore = downloadTokenStore;
|
||||||
this.pushTokenStore = pushTokenStore;
|
this.pushTokenStore = pushTokenStore;
|
||||||
@@ -8518,11 +8514,4 @@ export class Session {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCurrentBinaryBufferedAmount(): number {
|
|
||||||
const bufferedAmount = this.getBinaryBufferedAmount?.() ?? 0;
|
|
||||||
if (!Number.isFinite(bufferedAmount) || bufferedAmount < 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return Math.floor(bufferedAmount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -634,16 +634,6 @@ export class VoiceAssistantWebSocketServer {
|
|||||||
}
|
}
|
||||||
this.sendBinaryToConnection(connection, frame);
|
this.sendBinaryToConnection(connection, frame);
|
||||||
},
|
},
|
||||||
getBinaryBufferedAmount: () => {
|
|
||||||
if (!connection) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
let bufferedAmount = 0;
|
|
||||||
for (const socket of connection.sockets) {
|
|
||||||
bufferedAmount = Math.max(bufferedAmount, socket.bufferedAmount ?? 0);
|
|
||||||
}
|
|
||||||
return bufferedAmount;
|
|
||||||
},
|
|
||||||
onLifecycleIntent: (intent) => {
|
onLifecycleIntent: (intent) => {
|
||||||
this.onLifecycleIntent?.(intent);
|
this.onLifecycleIntent?.(intent);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user