google-gax
Advanced tools
Comparing version 2.28.0 to 2.28.1
@@ -52,2 +52,3 @@ /** | ||
stream?: CancellableStream; | ||
private _responseHasSent; | ||
/** | ||
@@ -54,0 +55,0 @@ * StreamProxy is a proxy to gRPC-streaming method. |
@@ -54,2 +54,3 @@ "use strict"; | ||
this._isCancelCalled = false; | ||
this._responseHasSent = false; | ||
} | ||
@@ -73,2 +74,14 @@ cancel() { | ||
}); | ||
// gRPC is guaranteed emit the 'status' event but not 'metadata', and 'status' is the last event to emit. | ||
// Emit the 'response' event if stream has no 'metadata' event. | ||
// This avoids the stream swallowing the other events, such as 'end'. | ||
stream.on('status', () => { | ||
if (!this._responseHasSent) { | ||
stream.emit('response', { | ||
code: 200, | ||
details: '', | ||
message: 'OK', | ||
}); | ||
} | ||
}); | ||
// We also want to supply the status data as 'response' event to support | ||
@@ -89,2 +102,3 @@ // the behavior of google-cloud-node expects. | ||
}); | ||
this._responseHasSent = true; | ||
}); | ||
@@ -91,0 +105,0 @@ } |
@@ -7,2 +7,9 @@ # Changelog | ||
### [2.28.1](https://www.github.com/googleapis/gax-nodejs/compare/v2.28.0...v2.28.1) (2021-11-10) | ||
### Bug Fixes | ||
* handle stream has no metadata event ([#1132](https://www.github.com/googleapis/gax-nodejs/issues/1132)) ([ad29bc2](https://www.github.com/googleapis/gax-nodejs/commit/ad29bc26567b588d5d694350844bea5de40963d6)) | ||
## [2.28.0](https://www.github.com/googleapis/gax-nodejs/compare/v2.27.1...v2.28.0) (2021-10-19) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "google-gax", | ||
"version": "2.28.0", | ||
"version": "2.28.1", | ||
"description": "Google API Extensions", | ||
@@ -27,3 +27,3 @@ "main": "build/src/index.js", | ||
"object-hash": "^2.1.1", | ||
"proto3-json-serializer": "^0.1.1", | ||
"proto3-json-serializer": "^0.1.5", | ||
"protobufjs": "6.11.2", | ||
@@ -70,5 +70,5 @@ "retry-request": "^4.0.0" | ||
"pumpify": "^2.0.0", | ||
"puppeteer": "^10.0.0", | ||
"puppeteer": "^11.0.0", | ||
"rimraf": "^3.0.0", | ||
"sinon": "^11.0.0", | ||
"sinon": "^12.0.0", | ||
"stream-events": "^1.0.4", | ||
@@ -75,0 +75,0 @@ "ts-loader": "^8.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10908260
163416