You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that if I install the app, but open it the very first time without any internet connection, so that the Segment SDK gets initialized without internet connection, no events will ever be pushed to Segment for that session, even after I regain internet connection again.
It is first after I restart the app that events are getting into Segment again, but only for the new session after the restart. The events that should have been created and pushed during the very first session that started without internet connection are lost for ever.
I can see these logs when running locally on iOS, which might be related to this issue:
Connection 13: received failure notification
Connection 13: failed to connect 1:50, reason 18 446 744 073 709 551 615
Connection 13: encountered error(1:50)
Task <9D428989-9D90-4661-8C10-18A09448F79B>.<2> HTTP load failed, 0/0 bytes (error code: 18 446 744 073 709 550 607 [1:50])
Task <9D428989-9D90-4661-8C10-18A09448F79B>.<2> finished with error [18 446 744 073 709 550 607] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x280501ad0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, _NSURLErrorNWResolutionReportKey=Resolved 0 endpoints in 2ms using unknown from cache, _NSURLErrorNWPathKey=unsatisfied (No network route)}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <9D428989-9D90-4661-8C10-18A09448F79B>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <9D428989-9D90-4661-8C10-18A09448F79B>.<2>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://cdn-settings.segment.com/v1/projects/Ui9dSUFlcu71Jnur5FOfyLWvI3xbIKwm/settings, NSErrorFailingURLKey=https://cdn-settings.segment.com/v1/projects/Ui9dSUFlcu71Jnur5FOfyLWvI3xbIKwm/settings, _kCFStreamErrorDomainKey=1}
'An internal error occurred: ', '{"type":3,"innerError":{},"statusCode":-1}'
'Could not receive settings from Segment. Device mode destinations will be ignored unless you specify default settings in the client config.'
The workaround I currently implemented for this is to check for internet connection before initializing the Segment SDK, and if it is the very first start of the app I do not initialize the SDK until internet connection is available through a network listener.
Any subsequent start of the app, after the Segment SDK has been initialized successfully with internet connection, does work as expected even without internet connection.
Also, I could not find anything about this in the documentation. If this was a known issue I would at least expect the documentation to state "Please make sure to have internet connection the first time you initialize the SDK".
I have noticed that if I install the app, but open it the very first time without any internet connection, so that the Segment SDK gets initialized without internet connection, no events will ever be pushed to Segment for that session, even after I regain internet connection again.
It is first after I restart the app that events are getting into Segment again, but only for the new session after the restart. The events that should have been created and pushed during the very first session that started without internet connection are lost for ever.
I can see these logs when running locally on iOS, which might be related to this issue:
The workaround I currently implemented for this is to check for internet connection before initializing the Segment SDK, and if it is the very first start of the app I do not initialize the SDK until internet connection is available through a network listener.
Any subsequent start of the app, after the Segment SDK has been initialized successfully with internet connection, does work as expected even without internet connection.
Also, I could not find anything about this in the documentation. If this was a known issue I would at least expect the documentation to state "Please make sure to have internet connection the first time you initialize the SDK".
analytics-react-native
version:Both Android and iOS.
Tested on Galaxy S21 5G with Android 13 and iPhone 11 with iOS 17.0.2
Steps to reproduce
Expected behavior
I would expect to see events being pushed to Segment after step 5 since internet connection will be available again at that point.
Actual behavior
No events at all are being pushed to Segment.
I have to restart the app, and only any new events will be pushed after the restart.
The text was updated successfully, but these errors were encountered: