Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase default timeout and change warning to info #984

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -676,11 +672,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
10 changes: 5 additions & 5 deletions examples/AnalyticsReactNativeExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ PODS:
- RNScreens (3.27.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- segment-analytics-react-native (2.19.2):
- segment-analytics-react-native (2.19.3):
- React-Core
- sovran-react-native
- SocketRocket (0.6.1)
- sovran-react-native (1.1.1):
- sovran-react-native (1.1.2):
- React-Core
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -752,12 +752,12 @@ SPEC CHECKSUMS:
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
RNGestureHandler: 32a01c29ecc9bb0b5bf7bc0a33547f61b4dc2741
RNScreens: 3c2d122f5e08c192e254c510b212306da97d2581
segment-analytics-react-native: 962494a9edbe3f6c5829e3b471484c85c304601c
segment-analytics-react-native: a803de6a9406f7b18928d352962c2f49663a0869
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
sovran-react-native: e6a9c963a8a6b9ebc3563394c39c30f33ab1453f
sovran-react-native: 5f02bd2d111ffe226d00c7b0435290eae6f10934
Yoga: eddf2bbe4a896454c248a8f23b4355891eb720a6
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 329f06ebb76294acf15c298d0af45530e2797740

COCOAPODS: 1.15.2
COCOAPODS: 1.11.3
11 changes: 3 additions & 8 deletions packages/core/src/plugins/QueueFlushingPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { defaultConfig } from '../constants';
import { UtilityPlugin } from '../plugin';
import { PluginType, SegmentEvent } from '../types';
import { createPromise } from '../util';
import { ErrorType, SegmentError } from '../errors';

/**
* This plugin manages a queue where all events get added to after timeline processing.
Expand All @@ -30,7 +29,7 @@ export class QueueFlushingPlugin extends UtilityPlugin {
constructor(
onFlush: (events: SegmentEvent[]) => Promise<void>,
storeKey = 'events',
restoreTimeout = 500
restoreTimeout = 1000
) {
super();
this.onFlush = onFlush;
Expand Down Expand Up @@ -78,12 +77,8 @@ export class QueueFlushingPlugin extends UtilityPlugin {
await this.isRestored;
} catch (e) {
// If the queue is not restored before the timeout, we will notify but not block flushing events
this.analytics?.reportInternalError(
new SegmentError(
ErrorType.InitializationError,
'Queue timeout before completed restoration',
e
)
console.info(
'Flush triggered but queue restoration and settings loading not complete. Flush will be retried.'
);
}
const events = (await this.queueStore?.getState(true))?.events ?? [];
Expand Down
Loading