-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws: Fix Pagination handling of empty string NextToken #94
Conversation
Fixes the SDK's handling of a Pagination NextToken's value being an empty string compared to a nil value. The SDK was expecting NextToken's to always be unset (nil) and treating any non-nil value as a valid value. This was not the case in MediaLive's List APIs. As those APIs return a empty string value instead of null or not setting the field at all. This issue exists in both the v1 and v2 SDKs. Fix aws#84
}{ | ||
{aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, | ||
{aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, | ||
{aws.String("ThirdValue"), aws.String("SecondToken"), nil}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a test to test for ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, TestPagination_Standalone is that testcase. The SDK already had this testcase but the way it worked prevented the bug from manifesting.
} | ||
|
||
tokenAdded = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they are bunch of empy strings, wouldn't tokenAdded
not be set to true
? Meaning this would never return the tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokenAdded
is present if a valid token is added. The tokens
slice is a sparse array. Its index directly correspond to indexes in another slice.
If all of the values at the outTokens
paths are empty strings there will be no valid tokens in the tokens
slice. In that case returning nil
would be the correct action. If there is at least one valid value in outTokens
paths the tokenAdded
will be set to true.
Release v2.0.0-preview.2 (2018-01-15) === ### Services * Synced the V2 SDK with latests AWS service API definitions. ### SDK Bugs * `service/s3/s3manager`: Fix Upload Manger's UploadInput fields ([#89](#89)) * Fixes [#88](#88) * `aws`: Fix Pagination handling of empty string NextToken ([#94](#94)) * Fixes [#84](#84)
Fixes the SDK's handling of a Pagination NextToken's value being an empty string compared to a nil value. The SDK was expecting NextToken's to always be unset (nil) and treating any non-nil value as a valid value. This was not the case in MediaLive's List APIs. As those APIs return a empty string value instead of null or not setting the field at all. V1 SDK port of aws/aws-sdk-go-v2#94
Fixes the SDK's handling of a Pagination NextToken's value being an empty string compared to a nil value. The SDK was expecting NextToken's to always be unset (nil) and treating any non-nil value as a valid value. This was not the case in MediaLive's List APIs. As those APIs return a empty string value instead of null or not setting the field at all. V1 SDK port of aws/aws-sdk-go-v2#94
) Fixes the SDK's handling of a Pagination NextToken's value being an empty string compared to a nil value. The SDK was expecting NextToken's to always be unset (nil) and treating any non-nil value as a valid value. This was not the case in MediaLive's List APIs. As those APIs return a empty string value instead of null or not setting the field at all. V1 SDK port of aws/aws-sdk-go-v2#94
Fixes the SDK's handling of a Pagination NextToken's value being an
empty string compared to a nil value. The SDK was expecting NextToken's
to always be unset (nil) and treating any non-nil value as a valid
value. This was not the case in MediaLive's List APIs. As those APIs
return a empty string value instead of null or not setting the field at
all.
This issue exists in both the v1 and v2 SDKs.
Fix #84