From d48b0cc5cd6fcb51da68649871506d38eb50d50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Fri, 27 Sep 2024 15:34:47 +0200 Subject: [PATCH] Rename analytics field error_message => message (#1382) --- handlers/analytics.go | 8 ++++---- handlers/analytics/log_processor.go | 4 ++-- handlers/analytics_test.go | 8 ++++---- handlers/schemas/AnalyticsLog.yaml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/handlers/analytics.go b/handlers/analytics.go index 2a34d340d..6eee1c8a8 100644 --- a/handlers/analytics.go +++ b/handlers/analytics.go @@ -73,8 +73,8 @@ type AnalyticsLogEvent struct { WindowWidthPX *int `json:"window_width_px"` // Error event - ErrorMessage *string `json:"error_message"` - Category *string `json:"category"` + Message *string `json:"message"` + Category *string `json:"category"` } type AnalyticsGeo struct { @@ -275,8 +275,8 @@ func (c *AnalyticsHandlersCollection) toAnalyticsData(log *AnalyticsLog, geo Ana WindowHeightPX: e.WindowHeightPX, WindowWidthPX: e.WindowWidthPX, - ErrorMessage: e.ErrorMessage, - Category: e.Category, + Message: e.Message, + Category: e.Category, }, }) } diff --git a/handlers/analytics/log_processor.go b/handlers/analytics/log_processor.go index f82da507d..bf34c4301 100644 --- a/handlers/analytics/log_processor.go +++ b/handlers/analytics/log_processor.go @@ -52,8 +52,8 @@ type LogDataEvent struct { WindowWidthPX *int `json:"window_width_px,omitempty"` // Error event - ErrorMessage *string `json:"error_message,omitempty"` - Category *string `json:"category,omitempty"` + Message *string `json:"message,omitempty"` + Category *string `json:"category,omitempty"` } type LogData struct { diff --git a/handlers/analytics_test.go b/handlers/analytics_test.go index b3c4613a8..72013d621 100644 --- a/handlers/analytics_test.go +++ b/handlers/analytics_test.go @@ -88,7 +88,7 @@ func TestHandleLog(t *testing.T) { "id": "abcde12345", "type": "error", "timestamp": 1234567895, - "error_message": "error message", + "message": "error message", "category": "offline" } ] @@ -161,9 +161,9 @@ func TestHandleLog(t *testing.T) { EventType: "error", EventTimestamp: 1234567895, EventData: analytics.LogDataEvent{ - ID: strPtr("abcde12345"), - ErrorMessage: strPtr("error message"), - Category: strPtr("offline"), + ID: strPtr("abcde12345"), + Message: strPtr("error message"), + Category: strPtr("offline"), }, }, }, diff --git a/handlers/schemas/AnalyticsLog.yaml b/handlers/schemas/AnalyticsLog.yaml index 36016c5fd..e5c40f155 100644 --- a/handlers/schemas/AnalyticsLog.yaml +++ b/handlers/schemas/AnalyticsLog.yaml @@ -45,7 +45,7 @@ properties: type: "integer" autoplay_status: type: "string" - error_message: + message: type: "string" required: - type