smithy-lang / smithy-typescript

Smithy code generators for TypeScript. (in development)
Apache License 2.0
223 stars 84 forks source link

Defaulting keepalive to true causing S3 PUT to fail #1020

Closed phillsv87 closed 8 months ago

phillsv87 commented 11 months ago

The FetchHttpHandler class now by default sets keepalive to true which is causing some of my S3 PUT requests to fail. I believe it is any request over 64KB . Defaulting to false or undefined or only defaulting to true for GET requests may be a better option.

I received the error message below when I first ran into the issue after upgrading all of my @aws-sdk and @smithy packages.

TypeError: Failed to fetch

Call Stack
FetchHttpHandler.handle
../node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js (56:0)

Here is a link to commit that sets keepalive to true: https://github.com/awslabs/smithy-typescript/commit/4528c37da78962c84f2c9f101503eeab1118d0b8#r129651348

As a temporary fix I reverted to @smithy/fetch-http-handler version 2.1.5

Here is my package.json before reverting

{
    "name": "____",
    "version": "0.1.4",
    "license": "MIT",
    "scripts": {},
    "private": true,
    "devDependencies": {
        "@babel/core": "7.12.13",
        "@babel/preset-react": "^7.14.5",
        "@babel/preset-typescript": "7.12.13",
        "@iyio/nx-common": "^0.3.5",
        "@next/bundle-analyzer": "^13.5.4",
        "@nrwl/cli": "^15.9.7",
        "@nrwl/devkit": "^15.9.7",
        "@nrwl/eslint-plugin-nx": "^15.9.7",
        "@nrwl/jest": "^15.9.7",
        "@nrwl/js": "^15.9.7",
        "@nrwl/linter": "^15.9.7",
        "@nrwl/next": "^15.9.7",
        "@nrwl/nx-plugin": "^15.9.7",
        "@nrwl/react": "^15.9.7",
        "@nrwl/storybook": "^15.9.7",
        "@nrwl/web": "^15.9.7",
        "@nrwl/webpack": "^15.9.7",
        "@nrwl/workspace": "^15.9.7",
        "@svgr/webpack": "^6.5.1",
        "@swc-node/register": "^1.6.8",
        "@swc/cli": "^0.1.62",
        "@swc/core": "^1.3.92",
        "@testing-library/react": "14.0.0",
        "@types/aws-lambda": "^8.10.104",
        "@types/jest": "28.1.1",
        "@types/node": "18.14.2",
        "@types/node-fetch": "^2.6.2",
        "@types/react": "18.0.28",
        "@types/react-dom": "18.0.11",
        "@types/uuid": "^8.3.4",
        "@typescript-eslint/eslint-plugin": "^5.36.1",
        "@typescript-eslint/parser": "^5.36.1",
        "aws-cdk": "2.100",
        "babel-jest": "28.1.1",
        "babel-loader": "8.1.0",
        "esbuild": "^0.19.4",
        "eslint": "~8.15.0",
        "eslint-config-next": "13.1.1",
        "eslint-config-prettier": "8.1.0",
        "eslint-plugin-import": "2.27.5",
        "eslint-plugin-jsx-a11y": "6.7.1",
        "eslint-plugin-react": "7.32.2",
        "eslint-plugin-react-hooks": "4.6.0",
        "jest": "28.1.1",
        "jest-environment-jsdom": "28.1.1",
        "jsonc-eslint-parser": "^2.1.0",
        "nx": "^15.9.7",
        "prettier": "^2.6.2",
        "prisma": "^5.2.0",
        "react-test-renderer": "18.2.0",
        "ts-jest": "28.0.5",
        "ts-node": "10.9.1",
        "tslib": "^2.4.0",
        "typescript": "^5.0.4"
    },
    "dependencies": {
        "@aws-cdk/aws-apigatewayv2-alpha": "^2.100.0-alpha.0",
        "@aws-cdk/aws-apigatewayv2-integrations-alpha": "^2.100.0-alpha.0",
        "@aws-sdk/client-apigatewaymanagementapi": "^3.427.0",
        "@aws-sdk/client-cognito-identity-provider": "^3.427.0",
        "@aws-sdk/client-dynamodb": "^3.427.0",
        "@aws-sdk/client-lambda": "^3.427.0",
        "@aws-sdk/client-rds-data": "^3.427.0",
        "@aws-sdk/client-s3": "^3.427.0",
        "@aws-sdk/client-secrets-manager": "^3.427.0",
        "@aws-sdk/credential-providers": "^3.427.0",
        "@aws-sdk/util-dynamodb": "^3.427.0",
        "@iyio/ai-complete": "^0.3.5",
        "@iyio/ai-complete-lambda": "^0.3.5",
        "@iyio/ai-complete-openai-cdk": "^0.3.5",
        "@iyio/at-dot-css": "^0.3.5",
        "@iyio/aws": "^0.3.5",
        "@iyio/aws-credential-providers": "^0.3.5",
        "@iyio/aws-dynamo": "^0.3.5",
        "@iyio/aws-lambda": "^0.3.5",
        "@iyio/aws-s3": "^0.3.5",
        "@iyio/aws-secrets": "^0.3.5",
        "@iyio/babel-plugin-macros": "^0.3.5",
        "@iyio/cdk-common": "^0.3.5",
        "@iyio/common": "^0.3.5",
        "@iyio/iyio-util-fns": "^0.3.5",
        "@iyio/media-common": "^0.3.5",
        "@iyio/nextjs-common": "^0.3.5",
        "@iyio/node-common": "^0.3.5",
        "@iyio/obj-sync": "^0.3.5",
        "@iyio/obj-sync-cdk": "^0.3.5",
        "@iyio/protogen": "^0.3.5",
        "@iyio/protogen-runtime": "^0.3.5",
        "@iyio/react-common": "^0.3.5",
        "@iyio/rtxt": "^0.3.5",
        "@smithy/protocol-http": "^3.0.7",
        "@smithy/signature-v4": "^2.0.11",
        "@swc/helpers": "^0.5.3",
        "@twilio/video-processors": "^2.0.0",
        "amazon-cognito-identity-js": "^6.2.0",
        "aws-cdk-lib": "2.100",
        "aws-jwt-verify": "^4.0.0",
        "blurhash": "^2.0.5",
        "cdk": "2.100",
        "constructs": "^10.1.308",
        "core-js": "^3.6.5",
        "date-fns": "^2.29.3",
        "highlight.js": "^11.7.0",
        "json5": "^2.2.3",
        "next": "13.1.1",
        "node-fetch": "^2.6.9",
        "openai": "^4.8.0",
        "pdfjs-dist": "3.10.111",
        "react": "18.2.0",
        "react-dom": "18.2.0",
        "regenerator-runtime": "0.13.7",
        "rxjs": "^7.8.0",
        "tslib": "^2.3.0",
        "twilio": "^4.7.1",
        "twilio-video": "^2.26.0",
        "uuid": "^9.0.0",
        "ws": "^8.13.0",
        "zod": "^3.21.4"
    }
}
kuhe commented 11 months ago

The default has been changed to false as of fetch-http-handler@2.2.3