Skip to content

feat: add sourceType to event tracking - #9

Merged
gunoooo merged 2 commits into
mainfrom
add-source-type
Feb 13, 2026
Merged

gunoooo merged 2 commits into
mainfrom
add-source-type

Conversation

@gunoooo

@gunoooo gunoooo commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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

Summary by CodeRabbit

  • Refactor
    • Event tracking now supports an optional sourceType field; tracking calls from notifications and new sessions include sourceType set to "CLIX".
  • Chore
    • Package version updated (0.0.4 → 0.0.5).

@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown

Walkthrough

Added an optional String? sourceType parameter to event tracking methods; EventService and EventAPIService accept and propagate it, and NotificationService and SessionService now pass sourceType: 'CLIX'. Package version bumped to 0.0.5.

Changes

Cohort / File(s) Summary
Event Service Core
lib/src/services/event_api_service.dart, lib/src/services/event_service.dart
Added optional String? sourceType parameter to trackEvent. EventAPIService conditionally includes source_type in request body; EventService forwards parameter to API service.
Event Tracking Call Sites
lib/src/services/notification_service.dart, lib/src/services/session_service.dart
Updated trackEvent invocations to pass sourceType: 'CLIX' (multiple calls updated in NotificationService, one in SessionService).
Manifest
pubspec.yaml
Version bumped from 0.0.4 to 0.0.5.

Possibly related PRs

  • feat: add session tracking #7 — Introduced SessionService/NotificationService hooks and related trackEvent flows that this change modifies; touches same methods and call sites.

Suggested reviewers

  • pitzcarraldo
  • nyanxyz
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a sourceType parameter to event tracking across multiple services.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
lib/src/services/notification_service.dart (1)

593-605: ⚠️ Potential issue | 🟡 Minor

Wrap _eventService?.trackEvent with try/catch here.
_trackPushEvent performs a core SDK operation without local exception handling. Wrap it to handle ClixError and log failures.

🔧 Proposed fix
   Future<void> _trackPushEvent(
       String eventType, Map<String, dynamic> clixPayload) async {
     final properties = _extractTrackingProperties(clixPayload);
     final messageId = clixPayload['message_id'] as String?;
 
-    await _eventService?.trackEvent(
-      eventType,
-      sourceType: 'CLIX',
-      properties: properties,
-      messageId: messageId,
-    );
-
-    ClixLogger.info('$eventType tracked: $messageId');
+    try {
+      await _eventService?.trackEvent(
+        eventType,
+        sourceType: 'CLIX',
+        properties: properties,
+        messageId: messageId,
+      );
+      ClixLogger.info('$eventType tracked: $messageId');
+    } on ClixError catch (e) {
+      ClixLogger.error('Failed to track $eventType', e);
+    } catch (e) {
+      ClixLogger.error('Failed to track $eventType', e);
+    }
   }
As per coding guidelines "Always wrap SDK operations in try-catch blocks to handle ClixError exceptions".

@gunoooo gunoooo changed the title Add sourceType to event tracking feat: add sourceType to event tracking Feb 13, 2026
@gunoooo
gunoooo merged commit d5260ca into main Feb 13, 2026
3 checks passed
@gunoooo
gunoooo deleted the add-source-type branch February 13, 2026 08:35
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