Repository navigation
feat: add sourceType to event tracking - #9
Conversation
WalkthroughAdded an optional Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
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 | 🟡 MinorWrap
_eventService?.trackEventwith try/catch here.
_trackPushEventperforms a core SDK operation without local exception handling. Wrap it to handle ClixError and log failures.As per coding guidelines "Always wrap SDK operations in try-catch blocks to handle ClixError exceptions".🔧 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); + } }
Summary
sourceType: "CLIX"추가sourceType파라미터 추가 (기본값 null, 브레이킹 체인지 없음)Summary by CodeRabbit