diff --git a/CHANGELOG.md b/CHANGELOG.md index c25ea6113..c5c45fede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- BugFix: Fix for `AbstactRestClient` failing to return when streaming a large dataset or USS file [#1805](https://github.com/zowe/zowe-cli/issues/1805), [#1813](https://github.com/zowe/zowe-cli/issues/1813), and [#1824](https://github.com/zowe/zowe-cli/issues/1824) + ## `5.18.2` - BugFix: Fixed normalization on stream chunk boundaries [#1815](https://github.com/zowe/zowe-cli/issues/1815) diff --git a/imperative b/imperative new file mode 160000 index 000000000..4d1224dbe --- /dev/null +++ b/imperative @@ -0,0 +1 @@ +Subproject commit 4d1224dbe713a9881f2f0435a1dbdcbb0f93be1c diff --git a/packages/rest/src/client/AbstractRestClient.ts b/packages/rest/src/client/AbstractRestClient.ts index 612e370db..0a3313f3c 100644 --- a/packages/rest/src/client/AbstractRestClient.ts +++ b/packages/rest/src/client/AbstractRestClient.ts @@ -699,6 +699,10 @@ export abstract class AbstractRestClient { causeErrors: this.dataString, source: "http" })); + }else if (this.mResponseStream != null && this.mResponseStream.writableEnded) { + // This will correct any instances where the finished event does not get emitted + // even though the stream processing has ended. + this.mResolve(this.dataString); } else if (this.mResponseStream != null && !this.mResponseStream.writableFinished) { this.mResponseStream.on("finish", () => this.mResolve(this.dataString)); } else {