Fix DynamoDB ExclusiveStartKey handling for AWS SDK v4#9884
Merged
ReubenBond merged 2 commits intodotnet:mainfrom Jan 20, 2026
Merged
Fix DynamoDB ExclusiveStartKey handling for AWS SDK v4#9884ReubenBond merged 2 commits intodotnet:mainfrom
ReubenBond merged 2 commits intodotnet:mainfrom
Conversation
The AWS SDK v4 upgrade (PR dotnet#9659) introduced stricter validation for the ExclusiveStartKey parameter in Scan and Query operations. An empty dictionary is now treated as an invalid key rather than being ignored. This fix: - Initializes exclusiveStartKey as null in ScanAsync instead of empty dict - Only sets ExclusiveStartKey on the request when it has a valid value - Applies the same pattern to QueryAsync for consistency Fixes test failures in AWS DynamoDB provider tests with error: 'The provided starting key is invalid'
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes DynamoDB provider test failures caused by stricter validation in AWS SDK v4. The SDK now treats empty dictionaries as invalid pagination keys rather than ignoring them, leading to "The provided starting key is invalid" errors in Scan and Query operations.
Changes:
- Modified
QueryAsyncto conditionally setExclusiveStartKeyonly when the pagination key is not null and not empty - Modified
ScanAsyncto initialize the pagination key as null instead of an empty dictionary and conditionally setExclusiveStartKeyonly when not null
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hey |
Member
Author
|
Hi @DarraghStauntonAngstrom, I'm working on it now. Hopefully we have a release in the coming hours. I'll notify this thread when we do |
Member
Author
|
v10.0.1 is now available |
This was referenced Feb 9, 2026
|
@ReubenBond Thanks so much! Really appreciate it! |
This was referenced Feb 9, 2026
Closed
Closed
This was referenced Feb 11, 2026
This was referenced Feb 18, 2026
This was referenced Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes DynamoDB provider test failures introduced by the AWS SDK v4 upgrade in PR #9659.
Problem
The AWS SDK v4 has stricter validation for the
ExclusiveStartKeyparameter in Scan and Query operations. Previously, the code initializedexclusiveStartKeyas an empty dictionary and always passed it toScanRequest.ExclusiveStartKey. The new SDK version treats an empty dictionary as an invalid key rather than ignoring it, causing the error:This affected multiple tests including:
MembershipTable_DynamoDB_GetGatewaysLiveness_AWS_DynamoDB_*testsFix
exclusiveStartKeyasnullinScanAsyncinstead of an empty dictionaryExclusiveStartKeyon the request when it has a valid value (not null)QueryAsyncfor consistencyTesting
Microsoft Reviewers: Open in CodeFlow