File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/cubejs-server/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,18 @@ export class WebSocketServer {
3131
3232 const connectionIdToSocket : Record < string , any > = { } ;
3333
34- this . subscriptionServer = this . serverCore . initSubscriptionServer ( ( connectionId : string , message : any ) => {
34+ this . subscriptionServer = this . serverCore . initSubscriptionServer ( async ( connectionId : string , message : any ) => {
3535 if ( ! connectionIdToSocket [ connectionId ] ) {
3636 throw new Error ( `Socket for ${ connectionId } is not found found` ) ;
3737 }
3838
3939 let messageStr : string ;
4040
41- if ( message . message instanceof ArrayBuffer ) {
42- // In case we already have a JSON-serialized query result, we don't want to parse/stringify
41+ if ( message . message && message . message . isWrapper ) {
42+ // In case we have a wrapped query result, we don't want to parse/stringify
4343 // it again - it's too expensive, instead we serialize the rest of the message and then
4444 // inject query result json into message.
45- const resMsg = new TextDecoder ( ) . decode ( message . message ) ;
45+ const resMsg = new TextDecoder ( ) . decode ( await message . message . getFinalResult ( ) ) ;
4646 message . message = '~XXXXX~' ;
4747 messageStr = JSON . stringify ( message ) ;
4848 messageStr = messageStr . replace ( '"~XXXXX~"' , resMsg ) ;
You can’t perform that action at this time.
0 commit comments