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 +4 -4
- data/CHANGELOG.md +28 -0
- data/app/controllers/error_radar/api/errors_controller.rb +1 -1
- data/app/controllers/error_radar/errors_controller.rb +2 -2
- data/app/models/error_radar/error_log.rb +4 -4
- data/app/views/error_radar/errors/index.html.erb +3 -3
- data/lib/error_radar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a67d42eee4ae7e2d87cd14daeea36484e94cb4e6408cf7d4867f5c00303dc6c2
|
|
4
|
+
data.tar.gz: ccdb606ec04483e63f572d524f5551c1d7306cb15d3314503bc46b3f76ecbea8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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.
|
|
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 :
|
|
20
|
-
|
|
21
|
-
|
|
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>
|
data/lib/error_radar/version.rb
CHANGED