From f32d27f94a3af89b5dab1dc1eabc952bfc8c6bb2 Mon Sep 17 00:00:00 2001 From: KevinLoesch1 Date: Wed, 18 Oct 2023 11:18:11 -0400 Subject: [PATCH 1/3] Fix for AbstractRestClient not returning Signed-off-by: KevinLoesch1 --- imperative | 1 + packages/rest/src/client/AbstractRestClient.ts | 4 ++++ 2 files changed, 5 insertions(+) create mode 160000 imperative 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 { From afd1db6bae66824f52caa2e6f8dad30cbc907d00 Mon Sep 17 00:00:00 2001 From: KevinLoesch1 Date: Wed, 18 Oct 2023 11:23:23 -0400 Subject: [PATCH 2/3] Update changelog Signed-off-by: KevinLoesch1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c25ea6113..d6589d545 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 larger file [#1805](https://github.com/zowe/zowe-cli/issues/1805) + ## `5.18.2` - BugFix: Fixed normalization on stream chunk boundaries [#1815](https://github.com/zowe/zowe-cli/issues/1815) From fabdcacf3e1ad5b5bc78901a519f4aa7516542e8 Mon Sep 17 00:00:00 2001 From: KevinLoesch1 Date: Wed, 18 Oct 2023 14:30:16 -0400 Subject: [PATCH 3/3] Update Changelog Signed-off-by: KevinLoesch1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6589d545..c5c45fede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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 larger file [#1805](https://github.com/zowe/zowe-cli/issues/1805) +- 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`