Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit c217bc8

Browse files
authored
fix key prefix logic (#5)
1 parent f1ea132 commit c217bc8

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the LaunchDarkly Node.js SDK DynamoDB integration will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [1.1.2] - 2019-01-16
6+
### Fixed:
7+
- The prefix property added in 1.1.0 did not work correctly: data was written with prefixed keys, but was read with non-prefixed keys. This has been fixed.
8+
59
## [1.1.1] - 2019-01-14
610
### Fixed:
711
- Fixed a potential race condition that could occur if one process is reading a feature flag while another one is updating the entire data set.

dynamodb_feature_store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function dynamoDBFeatureStoreInternal(tableName, options) {
194194

195195
function marshalItem(kind, item) {
196196
return {
197-
namespace: kind.namespace,
197+
namespace: namespaceForKind(kind),
198198
key: item.key,
199199
version: item.version,
200200
item: JSON.stringify(item)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ldclient-node-dynamodb-store",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "DynamoDB-backed feature store for the LaunchDarkly Node.js SDK",
55
"main": "dynamodb_feature_store.js",
66
"license": "Apache-2.0",
@@ -18,7 +18,7 @@
1818
"eslint-formatter-pretty": "1.3.0",
1919
"jest": "23.6.0",
2020
"jest-junit": "5.2.0",
21-
"ldclient-node": ">= 5.7.0",
21+
"ldclient-node": ">= 5.7.1",
2222
"typescript": "3.0.1"
2323
},
2424
"jest": {

tests/dynamodb_feature_store-test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ describe('DynamoDBFeatureStore', function() {
9090
return new DynamoDBFeatureStore(table, {cacheTTL: 0});
9191
}
9292

93+
function makeStoreWithPrefix(prefix) {
94+
return new DynamoDBFeatureStore(table, {prefix: prefix, cacheTTL: 0});
95+
}
96+
9397
function makeStoreWithHook(hook) {
9498
var store = makeStore();
9599
store.underlyingStore.testUpdateHook = hook;
@@ -101,7 +105,7 @@ describe('DynamoDBFeatureStore', function() {
101105
});
102106

103107
describe('uncached', function() {
104-
testBase.baseFeatureStoreTests(makeStoreWithoutCache, clearTable, false);
108+
testBase.baseFeatureStoreTests(makeStoreWithoutCache, clearTable, false, makeStoreWithPrefix);
105109
});
106110

107111
testBase.concurrentModificationTests(makeStore, makeStoreWithHook);

0 commit comments

Comments
 (0)