Skip to content

Commit

Permalink
Fixes based on PR feedback rev.2
Browse files Browse the repository at this point in the history
  • Loading branch information
boblodgett committed Dec 16, 2024
1 parent 70111d5 commit 13af660
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
15 changes: 14 additions & 1 deletion generator/.DevConfigs/460d1afb-6912-4244-82e2-cfb811a84743.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
{
"core": {
"changeLogMessages": [
"Updated DateTime handling."
"Updated DateTime handling to use UTC instead of local times.",
"DateTime handling (Breaking Change): Removed obsolete properties such EndTime then changed EndTimeUtc to EndTime. This could lead to offset times for developers still using the marked obsolete original EndTime for example. A compile time error will occur for anyone using any of the removed *Utc properties such as EndTimeUtc.",
"DateTime handling (Breaking Change): Response unmarshallers for TimeStamps and list TimeStamps for formats TimestampFormat.ISO8601 || TimestampFormat.RFC822 datetimes were being parsed into local times. Adjusted DateTime parsing to return UTC times.",
"DateTime handling (Breaking Change): Fixed the DateTimeUnmarshaller which was parsing datetime strings into and returning them as local time which in some cases were still getting converted back to UTC on a prior bug fix but not always. DateTime strings unmarshalled are assumed to be UTC time and will be specified and unmarshalled as UTC.",
"DateTime handling (Breaking Change): ConvertFromUnixEpochSeconds/ConvertFromUnixEpochMilliseconds incorrectly returning the Unix Epoch time as local time instead of a UTC time by definition. This changes the behavior where these methods were used.",
"DateTime handling (Breaking Change): DynamoDB RetrieveDateTimeInUtc has been switched to true as the default.",
"DateTime handling (Bug fix): Fixed internal Epoch dates to UTC per definition where the epoch date was created in local time. ",
"DateTime handling (Bug fix): Stopped using expiry times in credentials internally as local time. Changed to UTC.",
"DateTime handling (Bug fix): Ensured DateTime.Max and DateTime.Min are marked with a DateTime.Kind DateTimeKind.Utc for proper calculations.",
"DateTime handling (Bug fix): Instead of assuming SAML credentials are local time then converting to UTC and assume that the time given is UTC to work properly with credential expiration being in UTC time for other credential providers.",
"DateTime handling (Bug fix): Console logger outputs timestamps as a UTC date incase output is sent off the local machine and for easier comparison with other UTC dates.",
"DateTime handling (Bug fix): RetryPolicies return UTC server time instead of a UTC time converted to local time.",
"DateTime handling (Bug fix): AWSPublicIpAddressRanges mixing UTC and local time.",
"DateTime handling (Bug fix): GetFormattedTimestampISO8601 incorrectly creating a DateTime object as local time even though it is passed in as UTC. Then formatting it as a UTC string."
],
"type": "patch",
"updateMinimum": true
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Services/DynamoDBv2/Custom/AWSConfigs.DynamoDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public partial class DynamoDBContextConfig
/// <summary>
/// If true, all <see cref="DateTime"/> properties are retrieved in UTC timezone while reading data from DynamoDB. Else, the local timezone is used.
/// </summary>
/// <remarks>This setting is only applicable to the high-level library. Service calls made via <see cref="AmazonDynamoDBClient"/> will always
/// <remarks>This setting is only applicable to data retrieved from the DynamoDBContext object. Service calls made via <see cref="AmazonDynamoDBClient"/> will always
/// return <see cref="DateTime"/> attributes in UTC. The default is true to return datetimes in UTC format.</remarks>
public bool? RetrieveDateTimeInUtc { get; set; } = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ private bool IsInstructionFile(string key)
private bool ShouldDownload(S3Object s3o)
{
// skip objects based on ModifiedSinceDate
if (this._request.IsSetModifiedSinceDate() && s3o.LastModified.GetValueOrDefault().ToUniversalTime() <= this._request.ModifiedSinceDate.ToUniversalTime())
if (this._request.IsSetModifiedSinceDate() && s3o.LastModified.GetValueOrDefault() <= this._request.ModifiedSinceDate.ToUniversalTime())
return false;
// skip objects based on UnmodifiedSinceDate
if (this._request.IsSetUnmodifiedSinceDate() && s3o.LastModified.GetValueOrDefault().ToUniversalTime() > this._request.UnmodifiedSinceDate.ToUniversalTime())
if (this._request.IsSetUnmodifiedSinceDate() && s3o.LastModified.GetValueOrDefault() > this._request.UnmodifiedSinceDate.ToUniversalTime())
return false;
// skip objects which are instruction files and we're using encryption client
if (IsInstructionFile(s3o.Key))
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Services/S3/Custom/_bcl/IO/S3DirectoryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public string FullName
}

/// <summary>
/// Returns the last write time of the the latest file written to the directory.
/// Returns the last write time of the latest file written to the directory in local time.
/// </summary>
/// <exception cref="T:System.Net.WebException"></exception>
/// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
Expand Down Expand Up @@ -305,7 +305,7 @@ public DateTime LastWriteTime
}

/// <summary>
/// UTC converted version of LastWriteTime.
/// Returns the last write time of the latest file written to the directory in UTC time.
/// </summary>
/// <exception cref="T:System.Net.WebException"></exception>
/// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Services/S3/Custom/_bcl/IO/S3FileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public string FullName
}

/// <summary>
/// Returns the last time the file was modified.
/// Returns the last time the file was modified in local time.
/// </summary>
/// <exception cref="T:System.Net.WebException"></exception>
/// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
Expand Down Expand Up @@ -201,7 +201,7 @@ public DateTime LastWriteTime
}

/// <summary>
/// Returns the last time the file was modified in UTC.
/// Returns the last time the file was modified in UTC time.
/// </summary>
/// <exception cref="T:System.Net.WebException"></exception>
/// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
Expand Down

0 comments on commit 13af660

Please sign in to comment.