-
Notifications
You must be signed in to change notification settings - Fork 29
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 session start data issue #253
Conversation
This reverts commit d37d2d3.
val defaultSettings = configuration.defaultSettings ?: Settings( | ||
integrations = buildJsonObject { | ||
put( | ||
"Segment.io", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better to make this a constant in SegmentDestination and reference it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add constructors in Settings so it's consistent with swift's implementation and that forces every settings created to have a segment destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree, there are too many differences :( from swift.
@@ -89,7 +89,7 @@ abstract class DestinationPlugin : EventPlugin { | |||
override val type: Plugin.Type = Plugin.Type.Destination | |||
private val timeline: Timeline = Timeline() | |||
override lateinit var analytics: Analytics | |||
internal var enabled = false | |||
internal var enabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good catch! otherwise we might have issue when the user first opens the app offline and plugins are disabled by default.
We identified an issue with data loss that would occur when the host app would startup with no internet connection.
In these circumstances the SDK would not be able to download a valid Settings object and would not use either a good default or fallback to the previous known good Settings object.
This fix address various issues that lead to dataloss:
null
instead of an empty Settings object (parity with analytics-swit)true
instead offalse
(parity with intention of analytics-swift)Note: This PR contains a revert of a previous commit that set Configuration.settings object to an empty Settings object, so there are many changes related to the tests.