From b09ac89cd92ac72f4b85591faf1cfc7965f3a951 Mon Sep 17 00:00:00 2001 From: ShiKhu Date: Wed, 12 May 2021 23:37:23 +0200 Subject: [PATCH] fix (backend-db): issue_type for error hardcoded --- backend/pkg/db/postgres/messages_common.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/pkg/db/postgres/messages_common.go b/backend/pkg/db/postgres/messages_common.go index e91af068f..a6f624651 100644 --- a/backend/pkg/db/postgres/messages_common.go +++ b/backend/pkg/db/postgres/messages_common.go @@ -80,7 +80,12 @@ func (conn *Conn) InsertSessionEnd(sessionID uint64, timestamp uint64) (uint64, // Search acceleration if err := conn.exec(` UPDATE sessions - SET issue_types=(SELECT COALESCE(ARRAY_AGG(DISTINCT ps.type), '{}')::issue_type[] + SET issue_types=(SELECT + CASE WHEN errors_count > 0 THEN + (COALESCE(ARRAY_AGG(DISTINCT ps.type), '{}') || 'js_exception'::issue_type)::issue_type[] + ELSE + (COALESCE(ARRAY_AGG(DISTINCT ps.type), '{}'))::issue_type[] + END FROM events_common.issues INNER JOIN issues AS ps USING (issue_id) WHERE session_id = $1)