From 7d900b57bfe1c0ebaa9fa03f5f18f1f74b101402 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Wed, 19 Jun 2019 12:58:17 -0400 Subject: [PATCH] Fix createUnbufferedStream() function call In 49a21155f642670dfea264ac73fb60241f37cb87, I managed to incorrectly write the `createUnbufferedStream()` function from the AWS SDK as `getUnbufferedStream()` and to consistently use that naming in the unit tests. This commit fixes that. I have tested again on S3. --- services/filestore/app/coffee/S3PersistorManager.coffee | 2 +- .../filestore/test/unit/coffee/S3PersistorManagerTests.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/filestore/app/coffee/S3PersistorManager.coffee b/services/filestore/app/coffee/S3PersistorManager.coffee index 940ba90a95..8f1b080efd 100644 --- a/services/filestore/app/coffee/S3PersistorManager.coffee +++ b/services/filestore/app/coffee/S3PersistorManager.coffee @@ -102,7 +102,7 @@ module.exports = if statusCode not in [200, 206] logger.log({bucketName: bucketName, key: key }, "error getting file from s3: #{statusCode}") return callback(new Error("Got non-200 response from S3: #{statusCode} #{statusMessage}"), null) - stream = response.httpResponse.getUnbufferedStream() + stream = response.httpResponse.createUnbufferedStream() callback(null, stream) request.on 'error', (err) => diff --git a/services/filestore/test/unit/coffee/S3PersistorManagerTests.coffee b/services/filestore/test/unit/coffee/S3PersistorManagerTests.coffee index 5244fcb8f2..8a1b2e4d49 100644 --- a/services/filestore/test/unit/coffee/S3PersistorManagerTests.coffee +++ b/services/filestore/test/unit/coffee/S3PersistorManagerTests.coffee @@ -32,7 +32,7 @@ describe "S3PersistorManagerTests", -> send: sinon.stub() @s3Response = httpResponse: - getUnbufferedStream: sinon.stub() + createUnbufferedStream: sinon.stub() @s3Client = copyObject: sinon.stub() headObject: sinon.stub() @@ -64,7 +64,7 @@ describe "S3PersistorManagerTests", -> @expectedStream = { expectedStream: true } @s3Request.send.callsFake () => @s3EventHandlers.httpHeaders(200, {}, @s3Response, "OK") - @s3Response.httpResponse.getUnbufferedStream.returns(@expectedStream) + @s3Response.httpResponse.createUnbufferedStream.returns(@expectedStream) it "returns a stream", (done) -> @S3PersistorManager.getFileStream @bucketName, @key, {}, (err, stream) =>