Skip to content

Skipping empty string in update expressions as it used to convert to …#28

Open
EvgeniyHablak wants to merge 1 commit intomasterfrom
PBX-3382-be-address-empty-device-id-incident
Open

Skipping empty string in update expressions as it used to convert to …#28
EvgeniyHablak wants to merge 1 commit intomasterfrom
PBX-3382-be-address-empty-device-id-incident

Conversation

@EvgeniyHablak
Copy link

Changes made

key.go — Empty string hash key validation
isValidHashKey() now rejects empty string hash key values in addition to nil. This catches the problem early with a clear ErrInvalidHashKeyValue error instead of a cryptic SerializationException from AWS.

dynamo_repository.go — Skip empty strings in update expressions

Added isEmptyString() helper function

Both UpdateWithContext() and prepareUpdateWithUpdateExpressions() now skip any value that is an empty string ("") when building Set, SetSet, SetIfNotExists, and Add expressions. This prevents guregu/dynamo from marshaling empty strings to nil *dynamodb.AttributeValue, which was causing the SerializationException.

…nil which results in SerializationException;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant