Skip to content

KSM-839: fix AwsKeyValueStore.delete() skipping keys with falsy values - #967

Merged
stas-schaller merged 1 commit into
release/storage/javascript/aws-kms/v1.0.0from
KSM-839-fix-delete-falsy-values
Mar 16, 2026
Merged

stas-schaller merged 1 commit into
release/storage/javascript/aws-kms/v1.0.0from
KSM-839-fix-delete-falsy-values

Conversation

@stas-schaller

Copy link
Copy Markdown
Collaborator

Summary

AwsKeyValueStore.delete() used a truthy check (if (config[key])) to determine whether a key exists before deleting it. Any key holding a falsy value ("", 0, false, null) silently survived the delete call — the key persisted in storage and the logger falsely reported "Key not found." Fix applies the same key in config pattern already used by contains() (fixed in KSM-836).

Changes

Bug Fixes

  • delete() falsy-value skip (KSM-839): replace if (config[key]) with if (key in config) so keys holding "", 0, false, or null are correctly deleted

Testing

cd sdk/javascript/packages/aws
npm test

All 50 tests pass, including 3 new regression tests covering empty-string values, numeric zero values, and truly missing keys.

Breaking Changes

None.

Related Issues

  • Jira: KSM-839

@stas-schaller
stas-schaller merged commit 28d6e5f into release/storage/javascript/aws-kms/v1.0.0 Mar 16, 2026
3 checks passed
@stas-schaller
stas-schaller deleted the KSM-839-fix-delete-falsy-values branch March 16, 2026 15:23
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