Updated AWSSDK.S3 to 4.0
Prerequisites
- [X] I have written a descriptive pull-request title
- [X] I have verified that there are no overlapping pull-requests open
- [X] I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
- [ ] I have provided test coverage for my change (where applicable)
Description
Updated the AWSSDK.S3 to 4.0 release and fix the compilation issue.
Now metadata.LastModified can be null, I don't think it's like to happen in this scenario, but if it does the default Date is Now to assume the Image needs to be refreshed.
The 3.x range is also still being updated but I think we can upgrade to the 4.x range because we don't need net3.5 support
@dlemstra I'm not convinced we can update yet.
By doing so we introduce a breaking change via the dependency. Normally that would require a major version on our part.
@mdupras we have multiple failing tests here. Could you please have a look?
@dlemstra I'm not convinced we can update yet.
By doing so we introduce a breaking change via the dependency. Normally that would require a major version on our part.
@mdupras we have multiple failing tests here. Could you please have a look?
Thanks, I'm looking into it a bit. Managed to get the test failing locally, I'll try to take some time to investigate that soon!
@dlemstra I'm not convinced we can update yet. By doing so we introduce a breaking change via the dependency. Normally that would require a major version on our part. @mdupras we have multiple failing tests here. Could you please have a look?
Thanks, I'm looking into it a bit. Managed to get the test failing locally, I'll try to take some time to investigate that soon!
I had a look myself and there's something odd going on. The test is failing as there seems to be an additional 43 bytes of data attached (I'm assuming at the beginning of the stream) when we retrieve the file from the cache. I don't know yet whether this is an issue with the s3rver library or something in the SDK itself. I'm pulling down the SDK source now.
@mdupras to follow up I discovered that there was a behavioral change in AWS. It's inserting a byte sequence before our output.
51 = '3'
50 = '2'
67 = 'C'
13 = '\r'
10 = '\n'
32C\r\n is 812 followed by line breaks which is the correct length of the blob.
I added the following locally and everything works!! however I cannot get it to work in the CI on any OS.
PutObjectRequest request = new()
{
BucketName = this.bucketName,
Key = this.GetKeyWithFolder(key),
ContentType = metadata.ContentType,
InputStream = stream,
AutoCloseStream = false,
UseChunkEncoding = false // THIS WAS DEFAULTING TO TRUE
};
I've opened PR #392 to replace this one as I updated Azure also
Thanks @JimBobSquarePants ! I didn't have much time to put on this, but it never crossed my mind that somehow the new version now adds new bytes at the end.
The other annoying thing with the new version is if a static variable isn't changed, all the collections types in responses will be null instead of empty. Great way of sending nullref everywhere.