Skip to content

Commit fe98b43

Browse files
update
1 parent 1809619 commit fe98b43

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

package-lock.json

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dev": "rollup --config --watch",
2626
"lint": "eslint src/ test/",
2727
"fix-lint": "eslint src/ test/ --fix",
28-
"test": "mocha out/test/*.test.{js,cjs,mjs} --parallel"
28+
"test": "mocha out/test/load.test.{js,cjs,mjs} --parallel"
2929
},
3030
"repository": {
3131
"type": "git",

src/AzureAppConfigurationImpl.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ import { InvalidOperationError, ArgumentError, isFailoverableError, isInputError
6060

6161
const MIN_DELAY_FOR_UNHANDLED_FAILURE = 5_000; // 5 seconds
6262

63-
const MAX_TAG_FILTER_COUNT = 5;
64-
6563
type PagedSettingSelector = SettingSelector & {
6664
pageEtags?: string[];
6765
};
@@ -982,11 +980,11 @@ function getValidSettingSelectors(selectors: SettingSelector[]): SettingSelector
982980
const selector = { ...selectorCandidate };
983981
if (selector.snapshotName) {
984982
if (selector.keyFilter || selector.labelFilter || selector.tagFilters) {
985-
throw new ArgumentError("Key, label or tag filter should not be used for a snapshot.");
983+
throw new ArgumentError("Key, label or tag filters should not be specified while selecting a snapshot.");
986984
}
987985
} else {
988-
if (!selector.keyFilter && (!selector.tagFilters || selector.tagFilters.length === 0)) {
989-
throw new ArgumentError("Key filter and tag filter cannot both be null or empty.");
986+
if (!selector.keyFilter) {
987+
throw new ArgumentError("Key filter cannot be null or empty.");
990988
}
991989
if (!selector.labelFilter) {
992990
selector.labelFilter = LabelFilter.Null;
@@ -1041,9 +1039,6 @@ function getValidFeatureFlagSelectors(selectors?: SettingSelector[]): SettingSel
10411039
}
10421040

10431041
function validateTagFilters(tagFilters: string[]): void {
1044-
if (tagFilters.length > MAX_TAG_FILTER_COUNT) {
1045-
throw new Error(`The number of tag filters cannot exceed ${MAX_TAG_FILTER_COUNT}.`);
1046-
}
10471042
for (const tagFilter of tagFilters) {
10481043
const res = tagFilter.split("=");
10491044
if (res[0] === "" || res.length !== 2) {

test/load.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe("load", function () {
142142
selectors: [{
143143
labelFilter: "\0"
144144
}]
145-
})).eventually.rejectedWith("Key filter and tag filter cannot both be null or empty.");
145+
})).eventually.rejectedWith("Key filter cannot be null or empty.");
146146
});
147147

148148
it("should throw error given invalid snapshot selector", async () => {
@@ -152,7 +152,7 @@ describe("load", function () {
152152
snapshotName: "Test",
153153
labelFilter: "\0"
154154
}]
155-
})).eventually.rejectedWith("Key, label or tag filter should not be used for a snapshot.");
155+
})).eventually.rejectedWith("Key, label or tag filters should not be specified while selecting a snapshot.");
156156
});
157157

158158
it("should not include feature flags directly in the settings", async () => {
@@ -183,6 +183,7 @@ describe("load", function () {
183183
const connectionString = createMockedConnectionString();
184184
const loadWithTag1 = await load(connectionString, {
185185
selectors: [{
186+
keyFilter: "*",
186187
tagFilters: ["tag1=someValue"]
187188
}]
188189
});
@@ -194,6 +195,7 @@ describe("load", function () {
194195

195196
const loadWithMultipleTags = await load(connectionString, {
196197
selectors: [{
198+
keyFilter: "*",
197199
tagFilters: ["tag1=someValue", "tag2=someValue"]
198200
}]
199201
});
@@ -316,6 +318,7 @@ describe("load", function () {
316318
const connectionString = createMockedConnectionString();
317319
const loadWithInvalidTagFilter = load(connectionString, {
318320
selectors: [{
321+
keyFilter: "*",
319322
tagFilters: ["testTag"]
320323
}]
321324
});

0 commit comments

Comments
 (0)