Skip to content

fix(fetch-http-handler): handle empty blob in browsers#1199

Merged
AllanZhengYP merged 4 commits intoaws:masterfrom
AllanZhengYP:fix-stream-collector
May 26, 2020
Merged

fix(fetch-http-handler): handle empty blob in browsers#1199
AllanZhengYP merged 4 commits intoaws:masterfrom
AllanZhengYP:fix-stream-collector

Conversation

@AllanZhengYP
Copy link
Contributor

@AllanZhengYP AllanZhengYP commented May 25, 2020

Fixes #1198

This PR fixes the issue with returning none base64 encoded data for empty blob in browser.

The original readToBase64() in streamCollector from fetch-http-handler was migrated from stream-collector-native package which was only intended to be used in ReactNative environment. It handles empty blobs fine in ReactNative, but misses unit test for the case. When the stream-collector-native is merged into fetch-http-handler, it can also be used in browser runtime, which can have different behavior from different browser vendors. This results untested behavior in browser runtime.

/cc @Amplifiyer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AllanZhengYP AllanZhengYP force-pushed the fix-stream-collector branch from 169d16b to 4775326 Compare May 25, 2020 07:05
@aws-sdk-js-automation

This comment has been minimized.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 4775326
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@AllanZhengYP AllanZhengYP requested a review from trivikr May 26, 2020 15:41
@AllanZhengYP
Copy link
Contributor Author

Tested with with Amplify Storage component(code snippet below) locally on Firefox and Chrome:

  const { Storage, Amplify } = require("aws-amplify");
  Amplify.configure({
    Storage: {
      AWSS3: {
        bucket: "bucket",
        region,
        identityPoolId: IDENTITY_POOL_ID,
      },
    },
  });
  await Storage.put("abcd");

@AllanZhengYP AllanZhengYP requested a review from trivikr May 26, 2020 17:56
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 1e5fa45
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 00b0829
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 2d9c598
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@AllanZhengYP AllanZhengYP merged commit 9b8372b into aws:master May 26, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty blob decoding via base64 is causing issues in Chrome

3 participants