Skip to content

Commit

Permalink
Fix crashlytics errors count query to look at fatal errors only
Browse files Browse the repository at this point in the history
  • Loading branch information
nid90 committed Jan 8, 2025
1 parent baed33e commit 0b694c9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/libs/installations/crashlytics/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,19 @@ def crashlytics_query(dataset_name, bundle_identifier, platform, version_name, v
issue_id,
application.display_version AS version_name,
application.build_version AS version_code,
error_type,
event_timestamp,
bundle_identifier
FROM `#{table_name}`
WHERE event_timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
AND error_type = 'FATAL'
),
errors_with_version AS (
SELECT
issue_id,
version_name,
version_code,
error_type
version_code
FROM combined_events
WHERE error_type IS NOT NULL
AND version_code = "#{version_code}"
WHERE version_code = "#{version_code}"
AND version_name = "#{version_name}"
),
previous_errors AS (
Expand All @@ -96,7 +94,7 @@ def crashlytics_query(dataset_name, bundle_identifier, platform, version_name, v
)
SELECT
e.version_name AS version_name,
COUNT(*) AS errors_count,
COUNT(DISTINCT e.issue_id) AS errors_count,
COUNT(DISTINCT ne.issue_id) AS new_errors_count
FROM errors_with_version e
LEFT JOIN new_errors ne ON e.version_code = ne.version_code
Expand Down

0 comments on commit 0b694c9

Please sign in to comment.