Skip to content

feat: add sourceType to event tracking#20

Merged
gunoooo merged 5 commits intomainfrom
add-source-type
Feb 13, 2026
Merged

feat: add sourceType to event tracking#20
gunoooo merged 5 commits intomainfrom
add-source-type

Conversation

@gunoooo
Copy link
Contributor

@gunoooo gunoooo commented Feb 13, 2026

Summary

  • SESSION_START, PUSH_NOTIFICATION_RECEIVED, PUSH_NOTIFICATION_TAPPED 이벤트에 sourceType: "CLIX" 추가
  • EventService, EventAPIService에 sourceType 파라미터 추가 (기본값 null, 브레이킹 체인지 없음)

Summary by CodeRabbit

  • New Features

    • Event tracking accepts an optional source type to identify event origins.
    • Push notification and session events are now tagged with a default source value ("CLIX") for clearer origin attribution.
  • Tests

    • Updated tests to assert the presence of the new source type on relevant events.
  • Chores

    • Library version updated.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

Added an optional sourceType: String? = null field to event payloads, propagated the parameter through trackEvent APIs, updated internal calls to pass "CLIX" for certain events, bumped the clix version, and adjusted a test expectation.

Changes

Cohort / File(s) Summary
Event API / Data Model
clix/src/main/kotlin/so/clix/services/EventAPIService.kt
Added optional sourceType: String? = null to the EventForRequest data class constructor.
Event Service / API Usage
clix/src/main/kotlin/so/clix/services/EventService.kt
Added sourceType: String? = null parameter to trackEvent signature and forwarded it when constructing EventForRequest.
Notification & Session Calls
clix/src/main/kotlin/so/clix/services/NotificationService.kt, clix/src/main/kotlin/so/clix/services/SessionService.kt
Updated eventService.trackEvent invocations to include sourceType = "CLIX" for push notification and session start events.
Tests
clix/src/test/kotlin/so/clix/services/NotificationServiceTest.kt
Updated mock/verifier to expect sourceType = "CLIX" in eventService.trackEvent call.
Versioning
gradle/libs.versions.toml
Bumped clix version from 1.4.0 to 1.4.1.
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add sourceType to event tracking' accurately summarizes the main change: adding a sourceType field to event tracking across the SDK.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-source-type

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
clix/src/main/kotlin/so/clix/services/EventService.kt (1)

10-17: ⚠️ Potential issue | 🟡 Minor

Address Detekt LongParameterList violation.

The pipeline reports that trackEvent has too many parameters (6, which equals the threshold). While this is at the boundary, consider wrapping the optional tracking metadata into a data class to improve maintainability and avoid future violations if more parameters are needed.

💡 Suggested refactor using a parameter object
// Define a data class for event metadata
internal data class EventMetadata(
    val messageId: String? = null,
    val userJourneyId: String? = null,
    val userJourneyNodeId: String? = null,
    val sourceType: String? = null,
)

// Simplified trackEvent signature
suspend fun trackEvent(
    name: String,
    properties: Map<String, Any?> = emptyMap(),
    metadata: EventMetadata = EventMetadata(),
)

Alternatively, if this is acceptable for now, consider adjusting the Detekt configuration threshold or suppressing this specific case with @Suppress("LongParameterList").

@gunoooo gunoooo changed the title Add sourceType to event tracking feat: add sourceType to event tracking Feb 13, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
clix/src/test/kotlin/so/clix/services/NotificationServiceTest.kt (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Fix ktfmt formatting to unblock CI.

The pipeline reports that this file is not properly formatted. Run ./gradlew ktfmtFormat to auto-fix.

@gunoooo gunoooo merged commit 624d0cc into main Feb 13, 2026
3 checks passed
@gunoooo gunoooo deleted the add-source-type branch February 13, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant