@splitsoftware/splitio-commons 1.3.2-rc.6 → 1.3.2-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.txt CHANGED
@@ -1,4 +1,4 @@
1
- 1.4.0 (May 20, 2022)
1
+ 1.4.0 (May 24, 2022)
2
2
  - Added `scheduler.telemetryRefreshRate` property to SDK configuration, and deprecated `scheduler.metricsRefreshRate` property.
3
3
  - Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
4
4
  - Bugfixing - Updated default values for `scheduler.impressionsRefreshRate` config parameter: 300s for OPTIMIZED impression mode and 60s for DEBUG impression mode.
@@ -112,16 +112,9 @@ function settingsValidation(config, validationParams) {
112
112
  scheduler.offlineRefreshRate = fromSecondsToMillis(scheduler.offlineRefreshRate);
113
113
  scheduler.eventsPushRate = fromSecondsToMillis(scheduler.eventsPushRate);
114
114
  scheduler.telemetryRefreshRate = fromSecondsToMillis(validateMinValue('telemetryRefreshRate', scheduler.telemetryRefreshRate, 60));
115
- if (scheduler.impressionsRefreshRate !== exports.base.scheduler.impressionsRefreshRate) {
116
- // Validate impressionsRefreshRate defined by user
117
- scheduler.impressionsRefreshRate = validateMinValue('impressionsRefreshRate', scheduler.impressionsRefreshRate, withDefaults.sync.impressionsMode === constants_1.DEBUG ? 1 : 60 // Min is 1 sec for DEBUG and 60 secs for OPTIMIZED
118
- );
119
- }
120
- else {
121
- // Default impressionsRefreshRate for DEBUG mode is 60 secs
122
- if (withDefaults.sync.impressionsMode === constants_1.DEBUG)
123
- scheduler.impressionsRefreshRate = 60;
124
- }
115
+ // Default impressionsRefreshRate for DEBUG mode is 60 secs
116
+ if ((0, lang_1.get)(config, 'scheduler.impressionsRefreshRate') === undefined && withDefaults.sync.impressionsMode === constants_1.DEBUG)
117
+ scheduler.impressionsRefreshRate = 60;
125
118
  scheduler.impressionsRefreshRate = fromSecondsToMillis(scheduler.impressionsRefreshRate);
126
119
  // Log deprecation for old telemetry param
127
120
  if (scheduler.metricsRefreshRate)
@@ -1,4 +1,4 @@
1
- import { merge } from '../lang';
1
+ import { merge, get } from '../lang';
2
2
  import { mode } from './mode';
3
3
  import { validateSplitFilters } from './splitFilters';
4
4
  import { STANDALONE_MODE, OPTIMIZED, LOCALHOST_MODE, DEBUG } from '../constants';
@@ -109,16 +109,9 @@ export function settingsValidation(config, validationParams) {
109
109
  scheduler.offlineRefreshRate = fromSecondsToMillis(scheduler.offlineRefreshRate);
110
110
  scheduler.eventsPushRate = fromSecondsToMillis(scheduler.eventsPushRate);
111
111
  scheduler.telemetryRefreshRate = fromSecondsToMillis(validateMinValue('telemetryRefreshRate', scheduler.telemetryRefreshRate, 60));
112
- if (scheduler.impressionsRefreshRate !== base.scheduler.impressionsRefreshRate) {
113
- // Validate impressionsRefreshRate defined by user
114
- scheduler.impressionsRefreshRate = validateMinValue('impressionsRefreshRate', scheduler.impressionsRefreshRate, withDefaults.sync.impressionsMode === DEBUG ? 1 : 60 // Min is 1 sec for DEBUG and 60 secs for OPTIMIZED
115
- );
116
- }
117
- else {
118
- // Default impressionsRefreshRate for DEBUG mode is 60 secs
119
- if (withDefaults.sync.impressionsMode === DEBUG)
120
- scheduler.impressionsRefreshRate = 60;
121
- }
112
+ // Default impressionsRefreshRate for DEBUG mode is 60 secs
113
+ if (get(config, 'scheduler.impressionsRefreshRate') === undefined && withDefaults.sync.impressionsMode === DEBUG)
114
+ scheduler.impressionsRefreshRate = 60;
122
115
  scheduler.impressionsRefreshRate = fromSecondsToMillis(scheduler.impressionsRefreshRate);
123
116
  // Log deprecation for old telemetry param
124
117
  if (scheduler.metricsRefreshRate)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-commons",
3
- "version": "1.3.2-rc.6",
3
+ "version": "1.3.2-rc.7",
4
4
  "description": "Split Javascript SDK common components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -71,7 +71,7 @@ export function forOwn<T>(obj: { [key: string]: T }, iteratee: (value: T, key: s
71
71
  * Safely retrieve the specified prop from obj. If we can't retrieve
72
72
  * that property value, we return the default value.
73
73
  */
74
- export function get(obj: any, prop: any, val: any): any {
74
+ export function get(obj: any, prop: any, val?: any): any {
75
75
  let res = val;
76
76
 
77
77
  try { // No risks nor lots of checks.
@@ -1,4 +1,4 @@
1
- import { merge } from '../lang';
1
+ import { merge, get } from '../lang';
2
2
  import { mode } from './mode';
3
3
  import { validateSplitFilters } from './splitFilters';
4
4
  import { STANDALONE_MODE, OPTIMIZED, LOCALHOST_MODE, DEBUG } from '../constants';
@@ -131,15 +131,8 @@ export function settingsValidation(config: unknown, validationParams: ISettingsV
131
131
  scheduler.eventsPushRate = fromSecondsToMillis(scheduler.eventsPushRate);
132
132
  scheduler.telemetryRefreshRate = fromSecondsToMillis(validateMinValue('telemetryRefreshRate', scheduler.telemetryRefreshRate, 60));
133
133
 
134
- if (scheduler.impressionsRefreshRate !== base.scheduler.impressionsRefreshRate) {
135
- // Validate impressionsRefreshRate defined by user
136
- scheduler.impressionsRefreshRate = validateMinValue('impressionsRefreshRate', scheduler.impressionsRefreshRate,
137
- withDefaults.sync.impressionsMode === DEBUG ? 1 : 60 // Min is 1 sec for DEBUG and 60 secs for OPTIMIZED
138
- );
139
- } else {
140
- // Default impressionsRefreshRate for DEBUG mode is 60 secs
141
- if (withDefaults.sync.impressionsMode === DEBUG) scheduler.impressionsRefreshRate = 60;
142
- }
134
+ // Default impressionsRefreshRate for DEBUG mode is 60 secs
135
+ if (get(config, 'scheduler.impressionsRefreshRate') === undefined && withDefaults.sync.impressionsMode === DEBUG) scheduler.impressionsRefreshRate = 60;
143
136
  scheduler.impressionsRefreshRate = fromSecondsToMillis(scheduler.impressionsRefreshRate);
144
137
 
145
138
  // Log deprecation for old telemetry param
@@ -28,7 +28,7 @@ export declare function forOwn<T>(obj: {
28
28
  * Safely retrieve the specified prop from obj. If we can't retrieve
29
29
  * that property value, we return the default value.
30
30
  */
31
- export declare function get(obj: any, prop: any, val: any): any;
31
+ export declare function get(obj: any, prop: any, val?: any): any;
32
32
  /**
33
33
  * Parses an array into a map of different arrays, grouping by the specified prop value.
34
34
  */