fix: don't block message receiving even despite the ready state

This shouldn't be handled here. If both sides are following the protocol then there shouldn't be any messages before this side hasn't sent the ready answer.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-07-05 21:22:55 +02:00
parent e99a9f4855
commit 823b8e5ad5

View file

@ -44,10 +44,6 @@ export class MessageTransporter extends EventEmitter2<MessageEventPayloadMap> {
return return
} }
if (this.transportAdapter === undefined) {
throw new Error('no transport adapter set')
}
try { try {
this.transportAdapter.send(content) this.transportAdapter.send(content)
} catch (error: unknown) { } catch (error: unknown) {
@ -87,9 +83,6 @@ export class MessageTransporter extends EventEmitter2<MessageEventPayloadMap> {
this.processReadyAnswer() this.processReadyAnswer()
return return
} }
if (!this.isReady()) {
return
}
this.emit(message.type, message) this.emit(message.type, message)
} }