dispatch-rails 0.9.0 → 0.10.0

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: 797a73d62a39b0ab3640364d8ef71186b61f3233da2788f7733b72c85e77cc75
4
- data.tar.gz: 235fa20b827e25a6f0537e20d3cdd51221c0bebbed18013046901c9bdabf51ed
3
+ metadata.gz: 0fab7390093499294d3150088b49f04fc9fca920a711b33d1e8455e3a6ad2ea9
4
+ data.tar.gz: ba51af0c31c876c4d482445cb33353d56f97c5afb2a2dfc07d4a29e06a15d69d
5
5
  SHA512:
6
- metadata.gz: f3cbf75d09473580ec5f66ffaaf7d7623631c1a453bbe9b67b86e091e4fbcb56cd7da1ea141080b6375b714802915c00c4fd9f64d7c649bb2de7e6d6b46d1c0b
7
- data.tar.gz: f24f36ca5d2769053faa65cb5b77da6e09a28aea5b4e3166bcbb64e2473729cd9b54df4d6936572fe3ecb41937cb5e43e32f0b9de24f2c27b1879532da0232de
6
+ metadata.gz: dce4062b5290d5a1e82f3c7bdf01d73a279ac4fa01a63431ed2ed3f97e58f2592229fd02d09db26cf811c1a774e2edcadb5ea82d1bb1654b75918d886685c70c
7
+ data.tar.gz: b7d09382ab99f1962a6ea92007364f5798d7cda3c33f1bd92cc111c6895de49554d655ca9d8b87a2d1978d0812cbf5e29cdc66e4821a766db8e3c8e71e29b11c
data/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # Changelog
2
+
3
+ All notable changes to `dispatch-rails` are documented here. The format is based
4
+ on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.10.0] - 2026-06-18
8
+
9
+ ### Added
10
+ - `config.require_authenticated_user` (default `false`): when enabled,
11
+ `dispatch_widget_tag` renders nothing on requests where the `user` lambda
12
+ resolves to `nil` or a blank hash. Lets a host app keep the feedback widget
13
+ off public/unauthenticated pages (home page, EULA, privacy policy) so only
14
+ signed-in users can submit reports. Off by default to preserve existing
15
+ behavior — the stock `user` resolver returns `nil`, so defaulting it on would
16
+ hide the widget for apps that haven't wired up identity.
17
+
18
+ ## [0.9.0]
19
+
20
+ ### Added
21
+ - Capture SolidQueue infrastructure failures (pruned/orphaned jobs, thread
22
+ crashes, recurring-enqueue misses) that never flow through `Rails.error` or
23
+ ActiveJob.
24
+
25
+ ## [0.8.1]
26
+
27
+ ### Fixed
28
+ - `ReportingEndpointMiddleware` no longer swallows host-app errors when the
29
+ browser-reports path is not owned by the gem.
30
+
31
+ ## [0.8.0]
32
+
33
+ ### Added
34
+ - Browser CSP & Reporting-API capture (`capture_csp_violations`,
35
+ `capture_browser_reports`).
36
+
37
+ ## [0.7.0]
38
+
39
+ ### Added
40
+ - Process-lifecycle capture (crash-at-exit, rake failures, shutdown flush) for
41
+ Honeybadger parity.
data/README.md CHANGED
@@ -246,6 +246,22 @@ end
246
246
  <% end %>
247
247
  ```
248
248
 
249
+ ### Hiding the widget on public pages
250
+
251
+ By default the widget renders for everyone, including anonymous visitors. If you
252
+ only want signed-in users to be able to submit reports — keeping the button off
253
+ public surfaces like the home page, EULA, or privacy policy — opt in:
254
+
255
+ ```ruby
256
+ c.require_authenticated_user = true
257
+ ```
258
+
259
+ With this on, `dispatch_widget_tag` returns `nil` (renders nothing) on any
260
+ request where your `user` lambda resolves to `nil` or a blank hash, so make sure
261
+ that lambda is wired up to your auth. It's off by default because the stock
262
+ `user` resolver returns `nil`, and defaulting it on would hide the widget for
263
+ apps that haven't configured identity.
264
+
249
265
  ### Per-page severity / labels
250
266
 
251
267
  ```erb
@@ -13,6 +13,11 @@ module Dispatch
13
13
  return nil unless config.configured?
14
14
 
15
15
  user = config.user.respond_to?(:call) ? config.user.call(self) : nil
16
+ # Hide the widget on unauthenticated pages when the host opts in — keeps
17
+ # the report button off public surfaces (home page, EULA, …) where there
18
+ # is no signed-in user to attribute a report to.
19
+ return nil if config.require_authenticated_user && user.blank?
20
+
16
21
  base_metadata = config.metadata.respond_to?(:call) ? config.metadata.call(self) : {}
17
22
 
18
23
  page_metadata = base_metadata.to_h.merge(extra_metadata)
@@ -10,7 +10,8 @@ module Dispatch
10
10
  MODES = %i[widget errors_only].freeze
11
11
 
12
12
  # Bug-report widget
13
- attr_accessor :api_key, :endpoint, :user, :metadata, :capture_console, :capture_clicks, :button_position
13
+ attr_accessor :api_key, :endpoint, :user, :metadata, :capture_console, :capture_clicks, :button_position,
14
+ :require_authenticated_user
14
15
  # Mode + API-only context
15
16
  attr_accessor :mode, :context, :send_default_params
16
17
  # Exception tracking
@@ -38,6 +39,13 @@ module Dispatch
38
39
  @capture_console = false
39
40
  @capture_clicks = true # track the last few clicks as a "user path" for context
40
41
  @button_position = "bottom-right"
42
+ # Opt-in: hide the widget on requests with no resolved user (the `user`
43
+ # lambda returned nil/blank). Lets a host app keep the widget off
44
+ # public/unauthenticated pages — a home page, EULA, privacy policy —
45
+ # where anyone could otherwise submit a report. Off by default because
46
+ # the stock `user` resolver returns nil, so defaulting it on would hide
47
+ # the widget for every app that hasn't wired up identity.
48
+ @require_authenticated_user = false
41
49
 
42
50
  # Mode + API-only context
43
51
  @mode = :widget
@@ -1,5 +1,5 @@
1
1
  module Dispatch
2
2
  module Rails
3
- VERSION = "0.9.0".freeze
3
+ VERSION = "0.10.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dispatch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dispatch Team
@@ -39,6 +39,7 @@ executables: []
39
39
  extensions: []
40
40
  extra_rdoc_files: []
41
41
  files:
42
+ - CHANGELOG.md
42
43
  - README.md
43
44
  - app/assets/javascripts/dispatch/error_tracker.js
44
45
  - app/assets/javascripts/dispatch/widget.js