Skip to content

Commit fcaa6b8

Browse files
committed
[FSSDK-12147] update event retry default config
1 parent 083562f commit fcaa6b8

8 files changed

+22
-22
lines changed

lib/event_processor/batch_event_processor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@ import { sprintf } from "../utils/fns";
3333
import { SERVICE_STOPPED_BEFORE_RUNNING } from "../service";
3434
import { Platform } from '../platform_support';
3535

36-
export const DEFAULT_MIN_BACKOFF = 1000;
37-
export const DEFAULT_MAX_BACKOFF = 32000;
36+
export const DEFAULT_MIN_BACKOFF = 200;
37+
export const DEFAULT_MAX_BACKOFF = 1000;
3838
export const MAX_EVENTS_IN_STORE = 500;
3939

4040
export type EventWithId = {

lib/event_processor/event_processor_factory.browser.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -227,10 +227,10 @@ describe('createBatchEventProcessor', () => {
227227
expect(mockGetOpaqueBatchEventProcessor.mock.calls[1][0].batchSize).toBe(undefined);
228228
});
229229

230-
it('uses maxRetries value of 5 by default', () => {
230+
it('uses maxRetries value of 2 by default', () => {
231231
const processor = createBatchEventProcessor({ });
232232
expect(Object.is(processor, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true);
233-
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(5);
233+
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(2);
234234
});
235235

236236
it('uses the provided maxRetries value', () => {

lib/event_processor/event_processor_factory.browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store';
3232
import { Platform } from '../platform_support';
3333
export const DEFAULT_EVENT_BATCH_SIZE = 10;
3434
export const DEFAULT_EVENT_FLUSH_INTERVAL = 1_000;
35-
export const EVENT_MAX_RETRIES_BROWSER = 5;
35+
export const EVENT_MAX_RETRIES_BROWSER = 2;
3636

3737
export const createForwardingEventProcessor = (
3838
eventDispatcher: EventDispatcher = defaultEventDispatcher,

lib/event_processor/event_processor_factory.node.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -184,10 +184,10 @@ describe('createBatchEventProcessor', () => {
184184
expect(mockGetOpaqueBatchEventProcessor.mock.calls[1][0].batchSize).toBe(undefined);
185185
});
186186

187-
it('uses maxRetries value of 5 by default', () => {
187+
it('uses maxRetries value of 2 by default', () => {
188188
const processor = createBatchEventProcessor({ });
189189
expect(Object.is(processor, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true);
190-
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(5);
190+
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(2);
191191
});
192192

193193
it('uses the provided maxRetries value', () => {

lib/event_processor/event_processor_factory.node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import {
2727
import { Platform } from '../platform_support';
2828
export const DEFAULT_EVENT_BATCH_SIZE = 10;
2929
export const DEFAULT_EVENT_FLUSH_INTERVAL = 30_000;
30-
export const EVENT_MAX_RETRIES_NODE = 5;
30+
export const EVENT_MAX_RETRIES_NODE = 2;
3131

3232
export const createForwardingEventProcessor = (
3333
eventDispatcher: EventDispatcher = defaultEventDispatcher,

lib/event_processor/event_processor_factory.react_native.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -281,10 +281,10 @@ describe('createBatchEventProcessor', () => {
281281
expect(mockGetOpaqueBatchEventProcessor.mock.calls[1][0].batchSize).toBe(undefined);
282282
});
283283

284-
it('uses maxRetries value of 5 by default', () => {
284+
it('uses maxRetries value of 2 by default', () => {
285285
const processor = createBatchEventProcessor({});
286286
expect(Object.is(processor, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true);
287-
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(5);
287+
expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(2);
288288
});
289289

290290
it('uses the provided maxRetries value', () => {

lib/event_processor/event_processor_factory.react_native.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store';
3131
import { Platform } from '../platform_support';
3232
export const DEFAULT_EVENT_BATCH_SIZE = 10;
3333
export const DEFAULT_EVENT_FLUSH_INTERVAL = 1_000;
34-
export const EVENT_MAX_RETRIES_REACT_NATIVE = 5;
34+
export const EVENT_MAX_RETRIES_REACT_NATIVE = 2;
3535

3636
export const createForwardingEventProcessor = (
3737
eventDispatcher: EventDispatcher = defaultEventDispatcher,

lib/odp/odp_manager_factory.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2024-2025, Optimizely
2+
* Copyright 2024-2026, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,9 +32,9 @@ export const DEFAULT_CACHE_TIMEOUT = 600_000;
3232

3333
export const DEFAULT_EVENT_BATCH_SIZE = 100;
3434
export const DEFAULT_EVENT_FLUSH_INTERVAL = 10_000;
35-
export const DEFAULT_EVENT_MAX_RETRIES = 5;
36-
export const DEFAULT_EVENT_MIN_BACKOFF = 1000;
37-
export const DEFAULT_EVENT_MAX_BACKOFF = 32_000;
35+
export const DEFAULT_EVENT_MAX_RETRIES = 2;
36+
export const DEFAULT_EVENT_MIN_BACKOFF = 200;
37+
export const DEFAULT_EVENT_MAX_BACKOFF = 1_000;
3838

3939
export const INVALID_CACHE = 'Invalid cache';
4040
export const INVALID_CACHE_METHOD = 'Invalid cache method %s';

0 commit comments

Comments
 (0)