Skip to content

Commit

Permalink
Merge branch '3.5-dev' into cole/user-agent-manifest-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vkagamlyk authored Jan 14, 2023
2 parents 282a918 + 3992be1 commit bcee628
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Fixed an issue in Go and Python GLVs where modifying per request settings to override request_id's was not working correctly.
* Fixed incorrect implementation for `GraphTraversalSource.With` in `gremlin-go`.
* Changed Gremlin.version() to return `"VersionNotFound"` if the version is missing from the manifest.
* Fixed a case sensitivity issue when comparing request UUIDs in `gremlin-javascript`.
==== Bugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Connection extends EventEmitter {
*/
this.mimeType = options.mimeType || defaultMimeType;

// A map containing the request id and the handler
// A map containing the request id and the handler. The id should be in lower case to prevent string comparison issues.
this._responseHandlers = {};
this._reader = options.reader || this._getDefaultReader(this.mimeType);
this._writer = options.writer || this._getDefaultWriter(this.mimeType);
Expand Down Expand Up @@ -173,7 +173,8 @@ class Connection extends EventEmitter {

/** @override */
submit(processor, op, args, requestId) {
const rid = requestId || utils.getUuid();
// TINKERPOP-2847: Use lower case to prevent string comparison issues.
const rid = (requestId || utils.getUuid()).toLowerCase();
return this.open().then(
() =>
new Promise((resolve, reject) => {
Expand Down Expand Up @@ -201,7 +202,8 @@ class Connection extends EventEmitter {

/** @override */
stream(processor, op, args, requestId) {
const rid = requestId || utils.getUuid();
// TINKERPOP-2847: Use lower case to prevent string comparison issues.
const rid = (requestId || utils.getUuid()).toLowerCase();

const readableStream = new Stream.Readable({
objectMode: true,
Expand Down Expand Up @@ -315,6 +317,8 @@ class Connection extends EventEmitter {
return;
}

// TINKERPOP-2847: Use lower case to prevent string comparison issues.
response.requestId = response.requestId.toLowerCase();
const handler = this._responseHandlers[response.requestId];

if (!handler) {
Expand Down

0 comments on commit bcee628

Please sign in to comment.