diff --git a/packages/cubejs-client-ws-transport/src/index.ts b/packages/cubejs-client-ws-transport/src/index.ts index 947b47271f70e..2c28be16233ee 100644 --- a/packages/cubejs-client-ws-transport/src/index.ts +++ b/packages/cubejs-client-ws-transport/src/index.ts @@ -91,6 +91,9 @@ class WebSocketTransport implements ITransport { public async close(): Promise { if (this.ws) { + // Flush send queue before sending close frame + this.ws.sendQueue(); + this.ws.close(); } }