S3 Put File output changes

Wappler 4.4.2
NodeJS
Win 10 Pro

we are updating DB with the key returned by S3 Put File step.
putFile.Location is how we got this info.

in 4.4.2 - data returned by Put File is very different:
{“putFile”:{"$metadata":{“httpStatusCode”:200,“attempts”:1,“totalRetryDelay”:0},“ETag”:"“3fdd37a56efc12fbf23ecbb015d26707"”}}

can we please have the Location param back from Put File step?

this is unwelcome change - not informed of either via the changelog - affects multiple APIs - please fix!

We officially never returned the Location, the step returns the data as we get it from the AWS-SDK and this differs per SDK version.

Isn’t the Location just the bucket URL and the key combined? You should already have both to build the Location URL.

Personally, I don’t think the ability to workaround making the location is what’s required. Many of us will have existing projects that reference putFile.Location to store the file’s location in a DB. Are you saying that AWS have changed the SDK and no longer return this? Was there any notice from AWS for this change? It seems like quite a major one to me.

Ah. So it is the new V3 SDK that has a different response to V2 - that kind of change needs MUCH greater visibility, preferably with time to plan and adjust to changes. Could we have a project option to choose the version we want to use?

Are the PHP responses similarly changed?

The PHP version is on version 3, but the SDK for PHP is very different from the Javascript/NodeJs version and the ASP.NET version is also very different.

We never added the Location output to the Wappler UI because it was not consistent between the different SDK results. We only included the variables that where on all SDK versions available and made sure that these are also available in the upgraded version.

Seems someone on stackoverflow asked the same question:

Migration guide doesn’t mention any big breaking changes:
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/migrating-to-v3.html

There is more information at:

I will have a look at the differences in the v2 and v3 response, maybe there is a way to get the Location back in the response.

Thanks @patrick
I suspect it may be difficult because the full path has elements that rely on which AWS zone it is being stored in. Could we have a temporary roll back to V2 or an option to select version until the differences can be fully appraised?

You can test the following update, not sure if it is going to work with all providers. I added a try/catch around the code that adds the Location to prevent it from aborting the script when it doesn’t work.

s3.zip (1.3 KB) Unzip to lib/modules.

1 Like

Quick initial test and it looks good! Amazing work Patrick (as always)

This has been fixed in Wappler 4.4.3

This topic was automatically closed after 47 hours. New replies are no longer allowed.