error_radar 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa57ddbff3b17adcf34ffe470d8737be97f101ab213d90fa5f8539935b7a0e9b
4
- data.tar.gz: 3212bdf3d554b2c1f660bf42fd687afeb0707933c7cd67ca983b1bbbb01c7848
3
+ metadata.gz: a67d42eee4ae7e2d87cd14daeea36484e94cb4e6408cf7d4867f5c00303dc6c2
4
+ data.tar.gz: ccdb606ec04483e63f572d524f5551c1d7306cb15d3314503bc46b3f76ecbea8
5
5
  SHA512:
6
- metadata.gz: 31f315fbcdadf71bc578b82d8afb954f95410bda352889107240973832f4984d4fa4002a599a6abdc7852a38a1b6ebaeed0874acfe79d1fb69ff5c2f9c3fe956
7
- data.tar.gz: '04749c0c4ed4aaa062bbbd0bc30cfbed743b61ae072e3300c67c7cf6f7518e52fab74664efbe36465f4f5102016605d136fe454c103102026e80f064de8e5957'
6
+ metadata.gz: 14128cfcaf6abd33a6fd03c7b1e1fc86f1c0f6cfcc1e77a6f9317e886aad3bc780da4b342a6db222ad80bae2a3f910443fccee1ed1b2523b3e31996e690a6dee
7
+ data.tar.gz: 90c830658f039a376bc4889bb86ec8b054b93bfbe222f6bfb02643e1b9622e0813d7a11b141fb6a34057dd892727a62bf51fdb8ac6963750ccf15e44e946bd1c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.3] - 2026-07-03
6
+
7
+ ### Fixed
8
+ - **`::Digest::SHA1` namespace clash**: `ErrorRadar::Digest` (our digest mailer
9
+ module) was shadowing Ruby stdlib's `Digest` inside `ErrorLog.build_fingerprint`,
10
+ causing `NameError: uninitialized constant ErrorRadar::Digest::SHA1` on every
11
+ captured error. Fixed by using `::Digest::SHA1` (root-level constant path).
12
+ - **`ErrorLog` unresolved in views**: ERB templates run in `ActionView::Base`
13
+ context — outside the `ErrorRadar` module — so bare `ErrorLog` raised
14
+ `NameError: uninitialized constant ErrorLog` on the All Errors filter bar.
15
+ Changed to fully-qualified `ErrorRadar::ErrorLog` in the view.
16
+
17
+ ## [1.0.2] - 2026-07-03
18
+
19
+ ### Fixed
20
+ - **`has_many :error_occurrences` naming conflict**: renamed the association from
21
+ `:occurrences` to `:error_occurrences` on `ErrorLog` to stop it from shadowing
22
+ the `occurrences` integer column. The collision caused:
23
+ - 500 error on the All Errors page (`e.occurrences > 100` raised
24
+ `NoMethodError` because the column reader returned a `CollectionProxy`)
25
+ - Dashboard kanban cards showing
26
+ `count: #<ActiveRecord_Associations_CollectionProxy …>` instead of the
27
+ integer hit count
28
+ - `log.occurrences += 1` silently broken inside `ErrorLog.record`
29
+ - Updated `ErrorsController#show` and `Api::ErrorsController#serialize` to call
30
+ `error_occurrences` (the association) while leaving all other `log.occurrences`
31
+ calls reading the integer column as before.
32
+
5
33
  ## [1.0.1] - 2026-07-03
6
34
 
7
35
  ### Added
@@ -102,7 +102,7 @@ module ErrorRadar
102
102
 
103
103
  if ErrorRadar.config.track_occurrences
104
104
  begin
105
- data[:recent_occurrences] = log.occurrences.recent.limit(10).map do |occ|
105
+ data[:recent_occurrences] = log.error_occurrences.recent.limit(10).map do |occ|
106
106
  {
107
107
  id: occ.id,
108
108
  occurred_at: occ.occurred_at&.iso8601,
@@ -28,10 +28,10 @@ module ErrorRadar
28
28
  begin
29
29
  @occ_page = [params[:occ_page].to_i, 1].max
30
30
  occ_per_page = 20
31
- @occ_total = @error.occurrences.count
31
+ @occ_total = @error.error_occurrences.count
32
32
  @occ_total_pages = [(@occ_total.to_f / occ_per_page).ceil, 1].max
33
33
  @occ_page = [@occ_page, @occ_total_pages].min
34
- @occurrences = @error.occurrences.recent
34
+ @occurrences = @error.error_occurrences.recent
35
35
  .limit(occ_per_page)
36
36
  .offset((@occ_page - 1) * occ_per_page)
37
37
  rescue ActiveRecord::StatementInvalid
@@ -16,9 +16,9 @@ module ErrorRadar
16
16
 
17
17
  enum status: { open: 0, in_progress: 1, resolved: 2, ignored: 3 }, _prefix: :status
18
18
 
19
- has_many :occurrences, class_name: 'ErrorRadar::ErrorOccurrence',
20
- foreign_key: :error_log_id,
21
- dependent: :delete_all
19
+ has_many :error_occurrences, class_name: 'ErrorRadar::ErrorOccurrence',
20
+ foreign_key: :error_log_id,
21
+ dependent: :delete_all
22
22
 
23
23
  has_many :comments, class_name: 'ErrorRadar::ErrorComment',
24
24
  foreign_key: :error_log_id,
@@ -95,7 +95,7 @@ module ErrorRadar
95
95
  .gsub(/0x[0-9a-f]+/i, '0x#') # object addresses
96
96
  .gsub(/[0-9a-f]{8}-[0-9a-f-]{27}/i, '#') # uuids
97
97
  .strip
98
- Digest::SHA1.hexdigest([category, error_class, source, normalized].join('|'))
98
+ ::Digest::SHA1.hexdigest([category, error_class, source, normalized].join('|'))
99
99
  end
100
100
 
101
101
  def self.severity_rank(value)
@@ -70,21 +70,21 @@
70
70
 
71
71
  <select name="status">
72
72
  <option value="">All statuses</option>
73
- <% ErrorLog.statuses.each_key do |s| %>
73
+ <% ErrorRadar::ErrorLog.statuses.each_key do |s| %>
74
74
  <option value="<%= s %>" <%= 'selected' if fp['status'] == s %>><%= s.humanize %></option>
75
75
  <% end %>
76
76
  </select>
77
77
 
78
78
  <select name="severity">
79
79
  <option value="">All severities</option>
80
- <% ErrorLog.severities.each_key do |s| %>
80
+ <% ErrorRadar::ErrorLog.severities.each_key do |s| %>
81
81
  <option value="<%= s %>" <%= 'selected' if fp['severity'] == s %>><%= s.capitalize %></option>
82
82
  <% end %>
83
83
  </select>
84
84
 
85
85
  <select name="category">
86
86
  <option value="">All categories</option>
87
- <% ErrorLog.categories.each_key do |s| %>
87
+ <% ErrorRadar::ErrorLog.categories.each_key do |s| %>
88
88
  <option value="<%= s %>" <%= 'selected' if fp['category'] == s.to_s %>><%= s.to_s.humanize %></option>
89
89
  <% end %>
90
90
  </select>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErrorRadar
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_radar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - chienbn9x