Skip to content

Commit

Permalink
Merge pull request #165 from Microsoft/saw/utf8
Browse files Browse the repository at this point in the history
Work around gremlin client bug affecting UTF-8 data
  • Loading branch information
StephenWeatherford authored Nov 9, 2017
2 parents 7f27d5e + 9a20d3d commit 5dac0b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/graph/GraphViewServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ export class GraphViewServer extends EventEmitter {
"password": this._configuration.key
});

// Patch up handleProtocolMessage as a temporary work-around for https://github.com/jbmusso/gremlin-javascript/issues/93
var originalHandleProtocolMessage = client.handleProtocolMessage;
client.handleProtocolMessage = function handleProtocolMessage(message) {
if (!message.binary) {
// originalHandleProtocolMessage isn't handling non-binary messages, so convert this one back to binary
message.data = new Buffer(message.data);
message.binary = true;
}

originalHandleProtocolMessage.call(this, message);
};

return new Promise<[{}[]]>((resolve, reject) => {
client.execute(gremlinQuery, {}, (err, results) => {
if (err) {
Expand Down

0 comments on commit 5dac0b4

Please sign in to comment.