Skip to content

An open-source, self-hosted system for apps built with web technologies.

Keep writing to a command Server after a failed write

zohayrslileh9db731cf3542
diff --git a/source/server/core/server-runtime/command.ts b/source/server/core/server-runtime/command.ts
index 45bb3b3..8bac7f8 100644
--- a/source/server/core/server-runtime/command.ts
+++ b/source/server/core/server-runtime/command.ts
@@ -137,8 +137,9 @@ export default class CommandServerRuntime implements ServerRuntime {
const socket = this.socket
if (!socket) return
- this.writes = this.writes.then(() => writeFrame(socket, message, maximumFrameSize))
- this.writes.catch(() => undefined)
+ // A write that fails, such as a frame over the limit, is dropped on its own: the chain goes
+ // on, so every later message still reaches the Server.
+ this.writes = this.writes.then(() => writeFrame(socket, message, maximumFrameSize)).catch(() => undefined)
}
private print(stream: Stream, text: string) {