Skip to content

Commit

Permalink
Fix compressed exception lookup
Browse files Browse the repository at this point in the history
Check all exceptions for code 69 not just the first

This was breaking any report that sent other exceptions that were not the first.
  • Loading branch information
richardhallett committed Feb 7, 2024
1 parent 9753159 commit ea41f0a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def self.compressed_report?
# check for data sets !empty
return nil if exceptions.empty? || compressed.nil?

code = exceptions.first.fetch("code", "")
codes = exceptions.map { |exception| exception.fetch("code", "") }

(code == 69) && ((release.downcase == "rd1") || (release.downcase == "rd2"))
codes.include?(69) && ((release.downcase == "rd1") || (release.downcase == "rd2"))
end

def normal_report?
Expand All @@ -127,8 +127,9 @@ def normal_report?

def compressed_report?
return nil if self.exceptions.nil? || self.exceptions.empty?
code = self.exceptions.first.fetch("code", "")
(code == 69) && ((release.downcase == "rd1") || (release.downcase == "rd2"))
codes = exceptions.map { |exception| exception.fetch("code", "") }

codes.include?(69) && ((release.downcase == "rd1") || (release.downcase == "rd2"))
end

def resolution_report?
Expand Down

0 comments on commit ea41f0a

Please sign in to comment.