Skip to content

Commit a618c69

Browse files
Merge pull request #25 from drone/FFM-1507
[FFM-1507] metrics event target fixed, minor changes
2 parents 5f057fe + 1f8180d commit a618c69

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

example/package-lock.json

Lines changed: 1 addition & 1 deletion
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
@@ -1,6 +1,6 @@
11
{
22
"name": "@harnessio/ff-nodejs-server-sdk",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Feature flags SDK for NodeJS environments",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",

src/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const MetricsProcessor = (
157157
},
158158
{
159159
key: TARGET_ATTRIBUTE,
160-
value: event.target.identifier,
160+
value: event?.target?.identifier ?? null,
161161
},
162162
];
163163

src/polling.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { AxiosResponse } from 'axios';
21
import { ClientApi, FeatureConfig, Segment } from './openapi';
32
import { Options } from './types';
43
import EventEmitter from 'events';
@@ -65,9 +64,7 @@ export class PollingProcessor {
6564
.finally(pollAgain);
6665
}
6766

68-
private async retrieveFlags(): Promise<void | AxiosResponse<
69-
FeatureConfig[]
70-
>> {
67+
private async retrieveFlags(): Promise<void> {
7168
try {
7269
log.debug('Fetching flags started');
7370
const response = await this.api.getFeatureConfig(this.environment, {
@@ -85,7 +82,7 @@ export class PollingProcessor {
8582
}
8683
}
8784

88-
private async retrieveSegments(): Promise<void | AxiosResponse<Segment[]>> {
85+
private async retrieveSegments(): Promise<void> {
8986
try {
9087
log.debug('Fetching segments started');
9188
const response = await this.api.getAllSegments(this.environment, {

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export interface Operator {
5656
}
5757

5858
export interface Query {
59-
getFlag(identifier: string): Promise<FeatureConfig>;
60-
getSegment(identifier: string): Promise<Segment>;
59+
getFlag(identifier: string, cacheable?: boolean): Promise<FeatureConfig>;
60+
getSegment(identifier: string, cacheable?: boolean): Promise<Segment>;
6161
}
6262

6363
export interface KeyValueStore {

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = "1.1.0";
1+
export const VERSION = "1.1.1";

0 commit comments

Comments
 (0)