Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/cubejs-server/src/websocket-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@
// it again - it's too expensive, instead we serialize the rest of the message and then
// inject query result json into message.
const resMsg = new TextDecoder().decode(await message.message.getFinalResult());
message.message = '~XXXXX~';
delete message.message;

Check warning on line 46 in packages/cubejs-server/src/websocket-server.ts

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-server/src/websocket-server.ts#L46

Added line #L46 was not covered by tests
messageStr = JSON.stringify(message);
messageStr = messageStr.replace('"~XXXXX~"', resMsg);

if (messageStr === '{}') {
messageStr = `{"message":${resMsg}}`;

Check warning on line 50 in packages/cubejs-server/src/websocket-server.ts

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-server/src/websocket-server.ts#L50

Added line #L50 was not covered by tests
} else {
messageStr = `${messageStr.slice(0, -1)},"message":${resMsg}}`;

Check warning on line 52 in packages/cubejs-server/src/websocket-server.ts

View check run for this annotation

Codecov / codecov/patch

packages/cubejs-server/src/websocket-server.ts#L52

Added line #L52 was not covered by tests
}
} else {
messageStr = JSON.stringify(message);
}
Expand Down