[10.x] Handle empty arrays for DynamoDbStore multi-key operations #46579
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.
When using the DynamoDB cache driver, if someone passes an empty list of keys to
Cache::many([])
or an empty key/value array toCache::putMany([])
, DynamoDB will give an error response and the call will throw an exception. For example:This behaviour is unlike other cache drivers, which do not throw exceptions. For example:
That resulted in a papercut since I'm using the db driver for development and dynamo when deploying to vapor.
This PR adds a check for the array size and returns early if there's no Dynamo call to make.