fix: Connection._onMessage ham string iletiyordu, codec.decode patlıyordu
_onMessage JSON.parse yapıp obje iletiyordu → codec.decode 'unexpected frame type object' hatası fırlatıyordu → wsts/hello hiç işlenmiyordu → 5s timeout. Düzeltme: ham string/ArrayBuffer doğrudan callback'e geçiliyor, JSON parse işi codec.decode'a (WSTSProtocol.PackAnalyze) bırakılıyor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
66158b1f74
commit
f2d318d639
|
|
@ -80,11 +80,9 @@ export class Connection {
|
|||
}
|
||||
|
||||
_onMessage(data) {
|
||||
if (typeof data === 'string') {
|
||||
const parsed = JSON.parse(data);
|
||||
for (const cb of this._packCallbacks) cb(parsed);
|
||||
} else if (data instanceof ArrayBuffer) {
|
||||
// Binary frame — passed raw to WSTSProtocol for codec decoding.
|
||||
// Pass raw wire data to WSTSProtocol; codec.decode() handles parsing.
|
||||
// Pre-parsing here would hand an object to codec.decode which only accepts string/ArrayBuffer.
|
||||
if (typeof data === 'string' || data instanceof ArrayBuffer) {
|
||||
for (const cb of this._packCallbacks) cb(data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue