rails_error_dashboard 0.6.2 → 0.6.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: d065c1edba3f66205914ba82dbfc5aed936e0df62fd96df8f1dcd1667bc119af
4
- data.tar.gz: dff67e2453ec7d33429b5a4c07754b1e7d9c3103946cd5fdcb6ed282a3a14bce
3
+ metadata.gz: 938ab24cad38b8b20bc0dd0f2a1eb6e5c9e46a4634fb97e2c01b3487221c9fc3
4
+ data.tar.gz: 6e053a3f8c41e3c3f75f95ab1f9bd8908e9bcea4c473e2d1d3a0c11b7bdf0bdb
5
5
  SHA512:
6
- metadata.gz: 14b55055cb0a3c765824778c82cb7d8f33cd2d4ad5c445ea2e568fc10c51aec611271e0610fa295c8318a4701bba6a051db5f313ee6f12b4d6ac04be331df85f
7
- data.tar.gz: 0c154f205b6622ad747e3e037864b0e2bc2078f72098f71c2b26fb42d717a1b09a275e87ec29f2e34864684505b66b169f96efe8cc13910dc6a9f4c58fca5a4c
6
+ metadata.gz: 2b84b4a4f917863e7577e253f2324100a06b6fef6f33d56cef211f28a4f1dc4688932f618489f19924baa8aa065135cfcaeffb2c7431f15bea898d3e334395b7
7
+ data.tar.gz: 4149d8da317c77751e04db12b46f02924fe46e1a420075232e3fa7c96f12218166249596b33a55f1790e696b5fca3580cd5da62d38a39585e356660a702a518c
@@ -240,7 +240,7 @@ module RailsErrorDashboard
240
240
  resolution_comment: params[:resolution_comment]
241
241
  )
242
242
  when "mute"
243
- Commands::BatchMuteErrors.call(error_ids, muted_by: params[:muted_by])
243
+ Commands::BatchMuteErrors.call(error_ids, muted_by: params[:muted_by], reason: params[:reason])
244
244
  when "unmute"
245
245
  Commands::BatchUnmuteErrors.call(error_ids)
246
246
  when "delete"
@@ -61,7 +61,7 @@
61
61
  </td>
62
62
  <% end %>
63
63
  <td>
64
- <%= link_to "View Errors", errors_path(user_id: user_data[:user_id]), class: "btn btn-sm btn-outline-primary" %>
64
+ <%= link_to "View Errors", errors_path(user_id: user_data[:user_id], unresolved: '0'), class: "btn btn-sm btn-outline-primary" %>
65
65
  </td>
66
66
  </tr>
67
67
  <% end %>
@@ -148,7 +148,7 @@
148
148
  <div class="d-flex gap-2 flex-wrap">
149
149
  <small class="text-muted me-2">Quick Links:</small>
150
150
  <% @errors_by_platform.keys.each do |platform| %>
151
- <%= link_to platform, errors_path(platform: platform), class: "btn btn-sm btn-outline-secondary" %>
151
+ <%= link_to platform, errors_path(platform: platform, unresolved: '0'), class: "btn btn-sm btn-outline-secondary" %>
152
152
  <% end %>
153
153
  </div>
154
154
  </div>
@@ -304,7 +304,7 @@
304
304
  </div>
305
305
  </td>
306
306
  <td>
307
- <%= link_to "View Errors", errors_path(error_type: error_type), class: "btn btn-sm btn-outline-primary" %>
307
+ <%= link_to "View Errors", errors_path(error_type: error_type, unresolved: '0'), class: "btn btn-sm btn-outline-primary" %>
308
308
  </td>
309
309
  </tr>
310
310
  <% end %>
@@ -587,7 +587,7 @@
587
587
  </td>
588
588
  <td><strong><%= hours %> hours</strong></td>
589
589
  <td>
590
- <%= link_to "View", errors_path(severity: severity), class: "btn btn-sm btn-outline-primary" %>
590
+ <%= link_to "View", errors_path(severity: severity, unresolved: '0'), class: "btn btn-sm btn-outline-primary" %>
591
591
  </td>
592
592
  </tr>
593
593
  <% end %>
@@ -105,7 +105,7 @@
105
105
  <% end %>
106
106
  </td>
107
107
  <td>
108
- <%= link_to "View", errors_path(search: release[:version]), class: "btn btn-sm btn-outline-primary" %>
108
+ <%= link_to "View", errors_path(search: release[:version], unresolved: '0'), class: "btn btn-sm btn-outline-primary" %>
109
109
  </td>
110
110
  </tr>
111
111
  <% end %>
@@ -89,8 +89,8 @@
89
89
  <%= link_to errors_path(app_context.merge(unresolved: '0')), class: "btn filter-pill #{current_status.blank? && !is_unresolved_only ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>All<% end %>
90
90
  <%= link_to errors_path(app_context.merge(unresolved: '1')), class: "btn filter-pill #{is_unresolved_only && current_status.blank? ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Unresolved <span style="font-size: 11px; opacity: 0.7;"><%= @stats[:unresolved] %></span><% end %>
91
91
  <%= link_to errors_path(app_context.merge(status: 'resolved', unresolved: '0')), class: "btn filter-pill #{current_status == 'resolved' ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Resolved<% end %>
92
- <%= link_to errors_path(app_context.merge(assigned_to: '__assigned__')), class: "btn filter-pill #{params[:assigned_to] == '__assigned__' ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Assigned<% end %>
93
- <%= link_to errors_path(app_context.merge(reopened: 'true')), class: "btn filter-pill #{params[:reopened] == 'true' ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Reopened<% end %>
92
+ <%= link_to errors_path(app_context.merge(assigned_to: '__assigned__', unresolved: '0')), class: "btn filter-pill #{params[:assigned_to] == '__assigned__' ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Assigned<% end %>
93
+ <%= link_to errors_path(app_context.merge(reopened: 'true', unresolved: '0')), class: "btn filter-pill #{params[:reopened] == 'true' ? 'active btn-primary' : 'btn-outline-primary'}", style: "text-decoration: none;" do %>Reopened<% end %>
94
94
  </div>
95
95
 
96
96
  <div style="width: 1px; height: 24px; background: var(--border-primary);"></div>
@@ -88,7 +88,7 @@
88
88
  </div>
89
89
  </div>
90
90
  <div class="card-footer border-top">
91
- <%= link_to "View #{platform} Errors", errors_path(platform: platform), class: "btn btn-sm btn-outline-primary w-100" %>
91
+ <%= link_to "View #{platform} Errors", errors_path(platform: platform, unresolved: '0'), class: "btn btn-sm btn-outline-primary w-100" %>
92
92
  </div>
93
93
  </div>
94
94
  </div>
@@ -203,15 +203,15 @@
203
203
  <span style="font-size: 13px; font-weight: 600;">Quick Actions</span>
204
204
  </div>
205
205
  <div style="padding: var(--space-3) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2);">
206
- <%= link_to errors_path(app_context.merge(error_type: @error.error_type)), class: "btn btn-sm" do %>
206
+ <%= link_to errors_path(app_context.merge(error_type: @error.error_type, unresolved: '0')), class: "btn btn-sm" do %>
207
207
  <i class="bi bi-filter"></i> View Similar Errors
208
208
  <% end %>
209
209
  <% if @error.user_id %>
210
- <%= link_to errors_path(app_context.merge(user_id: @error.user_id)), class: "btn btn-sm" do %>
210
+ <%= link_to errors_path(app_context.merge(user_id: @error.user_id, unresolved: '0')), class: "btn btn-sm" do %>
211
211
  <i class="bi bi-person"></i> View User's Errors
212
212
  <% end %>
213
213
  <% end %>
214
- <%= link_to errors_path(app_context.merge(platform: @error.platform)), class: "btn btn-sm" do %>
214
+ <%= link_to errors_path(app_context.merge(platform: @error.platform, unresolved: '0')), class: "btn btn-sm" do %>
215
215
  <i class="bi bi-phone"></i> View <%= @error.platform %> Errors
216
216
  <% end %>
217
217
  <%= link_to analytics_errors_path(app_context), class: "btn btn-sm" do %>
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Backfill `status` column for errors that were bulk-resolved before v0.6.3.
4
+ #
5
+ # Versions 0.6.0 through 0.6.2 had a bug in BatchResolveErrors that set
6
+ # `resolved: true` and `resolved_at` but skipped the `status` column. The
7
+ # errors-index "Resolved" filter pill queries `where(status: 'resolved')`,
8
+ # so bulk-resolved errors silently disappeared from that view even though
9
+ # they were marked resolved.
10
+ #
11
+ # This migration is idempotent: it only updates rows that are out-of-sync
12
+ # (resolved but not status='resolved'). Running it twice is a no-op.
13
+ #
14
+ # See: https://github.com/AnjanJ/rails_error_dashboard
15
+ class BackfillResolvedStatus < ActiveRecord::Migration[7.0]
16
+ def up
17
+ return unless table_exists?(:rails_error_dashboard_error_logs)
18
+ return unless column_exists?(:rails_error_dashboard_error_logs, :status)
19
+ return unless column_exists?(:rails_error_dashboard_error_logs, :resolved)
20
+
21
+ # Use ActiveRecord update_all so the count is portable across adapters
22
+ # (PostgreSQL, MySQL, SQLite all return the affected row count).
23
+ table = ActiveRecord::Base.connection.quote_table_name("rails_error_dashboard_error_logs")
24
+ klass = Class.new(ActiveRecord::Base) { self.table_name = "rails_error_dashboard_error_logs" }
25
+ updated = klass.where(resolved: true).where("status IS NULL OR status != ?", "resolved")
26
+ .update_all(status: "resolved")
27
+
28
+ say "Backfilled status='resolved' on #{updated} error log(s) that were bulk-resolved on v0.6.0–v0.6.2."
29
+ end
30
+
31
+ def down
32
+ # No-op: we cannot reliably distinguish errors that were bulk-resolved
33
+ # before the fix from errors that are legitimately resolved now. Leaving
34
+ # status='resolved' is the safe choice on rollback.
35
+ end
36
+ end
@@ -4,13 +4,14 @@ module RailsErrorDashboard
4
4
  module Commands
5
5
  # Command: Mute multiple errors at once
6
6
  class BatchMuteErrors
7
- def self.call(error_ids, muted_by: nil)
8
- new(error_ids, muted_by).call
7
+ def self.call(error_ids, muted_by: nil, reason: nil)
8
+ new(error_ids, muted_by, reason).call
9
9
  end
10
10
 
11
- def initialize(error_ids, muted_by = nil)
11
+ def initialize(error_ids, muted_by = nil, reason = nil)
12
12
  @error_ids = Array(error_ids).compact
13
13
  @muted_by = muted_by
14
+ @reason = reason
14
15
  end
15
16
 
16
17
  def call
@@ -27,7 +28,8 @@ module RailsErrorDashboard
27
28
  error.update!(
28
29
  muted: true,
29
30
  muted_at: Time.current,
30
- muted_by: @muted_by
31
+ muted_by: @muted_by,
32
+ muted_reason: @reason
31
33
  )
32
34
  muted_count += 1
33
35
  muted_errors << error
@@ -31,7 +31,8 @@ module RailsErrorDashboard
31
31
  resolved: true,
32
32
  resolved_at: Time.current,
33
33
  resolved_by_name: @resolved_by_name,
34
- resolution_comment: @resolution_comment
34
+ resolution_comment: @resolution_comment,
35
+ status: "resolved"
35
36
  )
36
37
  resolved_count += 1
37
38
  resolved_errors << error
@@ -1,3 +1,3 @@
1
1
  module RailsErrorDashboard
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_error_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anjan Jagirdar
@@ -355,6 +355,7 @@ files:
355
355
  - db/migrate/20260323000001_add_muted_to_error_logs.rb
356
356
  - db/migrate/20260325000001_fix_swallowed_exceptions_index_for_mysql.rb
357
357
  - db/migrate/20260326000001_add_issue_tracking_to_error_logs.rb
358
+ - db/migrate/20260503000001_backfill_resolved_status.rb
358
359
  - lib/generators/rails_error_dashboard/install/install_generator.rb
359
360
  - lib/generators/rails_error_dashboard/install/templates/README
360
361
  - lib/generators/rails_error_dashboard/install/templates/initializer.rb
@@ -497,7 +498,7 @@ metadata:
497
498
  funding_uri: https://github.com/sponsors/AnjanJ
498
499
  post_install_message: |
499
500
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
500
- RED (Rails Error Dashboard) v0.6.2
501
+ RED (Rails Error Dashboard) v0.6.3
501
502
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
502
503
 
503
504
  First install: