File tree 2 files changed +6
-5
lines changed
core/src/main/java/com/segment/analytics/kotlin/core
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -509,11 +509,11 @@ open class Analytics protected constructor(
509
509
fun process (event : BaseEvent , enrichment : EnrichmentClosure ? = null) {
510
510
if (! enabled) return
511
511
512
- event.applyBaseData()
512
+ event.applyBaseData(enrichment )
513
513
514
514
log(" applying base attributes on ${Thread .currentThread().name} " )
515
515
analyticsScope.launch(analyticsDispatcher) {
516
- event.applyBaseEventData(store, enrichment )
516
+ event.applyBaseEventData(store)
517
517
log(" processing event on ${Thread .currentThread().name} " )
518
518
timeline.process(event)
519
519
}
Original file line number Diff line number Diff line change @@ -82,16 +82,16 @@ sealed class BaseEvent {
82
82
internal const val ALL_INTEGRATIONS_KEY = " All"
83
83
}
84
84
85
- internal fun applyBaseData () {
85
+ internal fun applyBaseData (enrichment : EnrichmentClosure ? ) {
86
+ this .enrichment = enrichment
86
87
this .timestamp = SegmentInstant .now()
87
88
this .context = emptyJsonObject
88
89
this .messageId = UUID .randomUUID().toString()
89
90
}
90
91
91
- internal suspend fun applyBaseEventData (store : Store , enrichment : EnrichmentClosure ? ) {
92
+ internal suspend fun applyBaseEventData (store : Store ) {
92
93
val userInfo = store.currentState(UserInfo ::class ) ? : return
93
94
94
- this .enrichment = enrichment
95
95
this .anonymousId = userInfo.anonymousId
96
96
this .integrations = emptyJsonObject
97
97
@@ -123,6 +123,7 @@ sealed class BaseEvent {
123
123
integrations = original.integrations
124
124
userId = original.userId
125
125
_metadata = original._metadata
126
+ enrichment = original.enrichment
126
127
}
127
128
@Suppress(" UNCHECKED_CAST" )
128
129
return copy as T // This is ok because resultant type will be same as input type
You can’t perform that action at this time.
0 commit comments