Skip to content

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

Merged
sjakobs merged 2 commits into
masterfrom
PBX-3382-be-address-empty-device-id-incident
Mar 17, 2026
Merged

Skipping empty string in update expressions as it used to convert to …#28
sjakobs merged 2 commits into
masterfrom
PBX-3382-be-address-empty-device-id-incident

Conversation

@EvgeniyHablak
Copy link
Copy Markdown
Contributor

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;
Comment thread dynamo_repository.go Outdated
Comment thread dynamo_repository.go Outdated
Comment thread dynamo_repository.go Outdated
Comment thread dynamo_repository.go
@sjakobs sjakobs merged commit 7fec125 into master Mar 17, 2026
1 check passed
pm-nilesh-chate added a commit to pm-nilesh-chate/djoemo that referenced this pull request Apr 29, 2026
Signed-off-by: Nilesh Chate <nilesh.chate@adjoe.io>
pm-nilesh-chate pushed a commit to pm-nilesh-chate/djoemo that referenced this pull request Apr 29, 2026
pm-nilesh-chate added a commit to pm-nilesh-chate/djoemo that referenced this pull request Apr 29, 2026
sjakobs pushed a commit that referenced this pull request Apr 30, 2026
* Revert "Skipping empty string in update expressions as it used to convert to … (#28)"

This reverts commit 7fec125.

* add tests
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.

3 participants