Github user mattallenuk commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/889#discussion_r201431625
--- Diff:
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
---
@@ -151,7 +156,16 @@ class DriverRemoteConnection extends RemoteConnection {
return;
}
- if (response.status.code >= 400) {
+ if (response.status.code ===
responseStatusCode.authenticationChallenge && this._authenticator) {
+ this._authenticator.evaluateChallenge(response).then(res => {
--- End diff --
On this problem, the issue is that submit creates a new requestId for each
message sent. So when sending the auth response a new requestId is created for
that authentication response. The Gremlin server responds with the requestId of
the previous call so the authentication requestId never gets dealt with. Am I
right in thinking that your proposal is to remove all pending handlers from the
handler array? Is it safe to assume that there will only ever be one handler at
a time in that array, apart from when authentication is happening? Am I making
sense?
---