Skip to content

Commit 39028c1

Browse files
enhance split filters documentation
1 parent 8cc3531 commit 39028c1

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/sync/polling/updaters/splitChangesUpdater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ interface ISplitMutations<T extends ISplit | IRBSegment> {
5959

6060
/**
6161
* If there are defined filters and one feature flag doesn't match with them, its status is changed to 'ARCHIVE' to avoid storing it
62-
* If there are set filter defined, names filter is ignored
62+
* If there is `bySet` filter, `byName` and `byPrefix` filters are ignored
6363
*
6464
* @param featureFlag - feature flag to be evaluated
6565
* @param filters - splitFiltersValidation bySet | byName

src/utils/settingsValidation/splitFilters.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ function validateSplitFilter(log: ILogger, type: SplitIO.SplitFilterType, values
6969
/**
7070
* Returns a string representing the URL encoded query component of /splitChanges URL.
7171
*
72-
* The possible formats of the query string are:
73-
* - null: if all filters are empty
74-
* - '&names=<comma-separated-values>': if only `byPrefix` filter is undefined
75-
* - '&prefixes=<comma-separated-values>': if only `byName` filter is undefined
76-
* - '&names=<comma-separated-values>&prefixes=<comma-separated-values>': if no one is undefined
77-
*
7872
* @param groupedFilters - object of filters. Each filter must be a list of valid, unique and ordered string values.
7973
* @returns null or string with the `split filter query` component of the URL.
8074
*/

types/splitio.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ interface ISharedSettings {
2424
sync?: {
2525
/**
2626
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment, in order to reduce the delay of the SDK to be ready.
27-
* This configuration is only meaningful when the SDK is working in "standalone" mode.
27+
*
28+
* NOTES:
29+
* - This configuration is only meaningful when the SDK is working in `"standalone"` mode.
30+
* - If `bySet` filter is provided, `byName` and `byPrefix` filters are ignored.
31+
* - If both `byName` and `byPrefix` filters are provided, the intersection of the two groups of feature flags is fetched.
2832
*
2933
* Example:
3034
* ```
@@ -69,7 +73,7 @@ interface ISharedSettings {
6973
* const factory = SplitFactory({
7074
* ...
7175
* sync: {
72-
* getHeaderOverrides(context) {
76+
* getHeaderOverrides: (context) => {
7377
* return {
7478
* 'Authorization': context.headers['Authorization'] + ', other-value',
7579
* 'custom-header': 'custom-value'
@@ -1135,7 +1139,7 @@ declare namespace SplitIO {
11351139
*/
11361140
type: SplitFilterType;
11371141
/**
1138-
* List of values: feature flag names for 'byName' filter type, and feature flag name prefixes for 'byPrefix' type.
1142+
* List of values: flag set names for 'bySet' filter type, feature flag names for 'byName' filter type, and feature flag name prefixes for 'byPrefix' type.
11391143
*/
11401144
values: string[];
11411145
}
@@ -1358,7 +1362,7 @@ declare namespace SplitIO {
13581362
* const factory = SplitFactory({
13591363
* ...
13601364
* sync: {
1361-
* getHeaderOverrides(context) {
1365+
* getHeaderOverrides: (context) => {
13621366
* return {
13631367
* 'Authorization': context.headers['Authorization'] + ', other-value',
13641368
* 'custom-header': 'custom-value'

0 commit comments

Comments
 (0)