-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I got a weird issue with the Segment client initialization. The client did not initialize correctly due to the processing of pending events. It happened from the second time.
It does not happen on the latest Segment version, but the upgrade does not help due to the cache is still persisted between app updates.
analytics-react-native
version: 2.20.0- Integrations versions (if used): no
- React Native version: 0.74.3 (Expo SDK 51.0.20)
- iOS or Android or both? Tested on iOS 17
Steps to reproduce
- Integrate Segment as normal.
- Open the app for the first time.
- Quit the app completely, kill it in the recent menu.
- Open the app again, and it throws an error (
An internal error occurred: [Error: Client did not initialize correctly]
). No events can be sent.
Expected behavior
- The Segment client initializes successfully, and events are sent to the dashboard following the flush policy.
Actual behavior
- The second time the app opens, Segment client inits the pending events as an object instead of an array.
- I placed a log in the SegmentClient class ->
onReady
function. It showspending
is not an array, which causes the next code block (thefor of
loop) to throw a type error and stop the initialization process.

benszedlmayer
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working