activerabbit-ai 0.6.1 → 0.6.2
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 +15 -0
- data/lib/active_rabbit/client/action_mailer_patch.rb +22 -6
- data/lib/active_rabbit/client/version.rb +1 -1
- metadata +2 -3
- data/activerabbit-ai-0.4.5.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c71eb72533f7d6588444722f3ca8502230006f75bd12cee11b7f585e0a00aa1a
|
|
4
|
+
data.tar.gz: e187bb60976eda2eccd743589737240f40930897f6063c9ff6b061e517786135
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97ffc354514d50a73b8f32dd086e6d2a095bea00e0ce095464c7ea0a389fc8b1304359125a798abfabf4f456095aec51f3a086a2f6cb1d4c0d3eb5367d1744f0
|
|
7
|
+
data.tar.gz: dafed4a9c5c2de391bdc1527de3092340a093afdde7cc336a04c533c7d4898d5fad4987992fa3861dbbf806dd792eaa8e2a1037cc0a00133e235cd86747a4e3e
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.2] - 2026-01-26
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **ActionMailer deliver_later RuntimeError**: Fixed critical bug where `deliver_later` would raise `RuntimeError: You've accessed the message before asking to deliver it later`
|
|
9
|
+
- The patch was incorrectly accessing `message.subject` and `message.to` before calling `super`
|
|
10
|
+
- Rails requires that `message` is NOT accessed before `deliver_later` because only mailer method arguments are passed to the job
|
|
11
|
+
- Now only tracks safe metadata: `@mailer_class`, `@action`, and argument types
|
|
12
|
+
- Added error handling to ensure tracking failures don't break email delivery
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **ActionMailer patch tests**: 18 comprehensive tests for the ActionMailer integration
|
|
16
|
+
- Verifies `deliver_later` does NOT access the message object
|
|
17
|
+
- Verifies `deliver_now` correctly tracks message details
|
|
18
|
+
- Tests error handling and edge cases
|
|
19
|
+
|
|
5
20
|
## [0.6.1] - 2026-01-09
|
|
6
21
|
|
|
7
22
|
### Fixed
|
|
@@ -14,7 +14,8 @@ module ActiveRabbit
|
|
|
14
14
|
ActiveRabbit::Client.track_event(
|
|
15
15
|
"email_sent",
|
|
16
16
|
{
|
|
17
|
-
|
|
17
|
+
mailer_class: @mailer_class.name,
|
|
18
|
+
action: @action,
|
|
18
19
|
message_id: (message.message_id rescue nil),
|
|
19
20
|
subject: (message.subject rescue nil),
|
|
20
21
|
to: (Array(message.to).first rescue nil),
|
|
@@ -24,11 +25,26 @@ module ActiveRabbit
|
|
|
24
25
|
end
|
|
25
26
|
end
|
|
26
27
|
|
|
27
|
-
def deliver_later
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
def deliver_later(...)
|
|
29
|
+
# IMPORTANT: Do NOT access `message` here!
|
|
30
|
+
# Rails raises RuntimeError if you access the message before deliver_later
|
|
31
|
+
# because only mailer method arguments are passed to the job.
|
|
32
|
+
# We can only safely access metadata that doesn't touch the message object.
|
|
33
|
+
if ActiveRabbit::Client.configured?
|
|
34
|
+
begin
|
|
35
|
+
ActiveRabbit::Client.track_event(
|
|
36
|
+
"email_enqueued",
|
|
37
|
+
{
|
|
38
|
+
mailer_class: @mailer_class.name,
|
|
39
|
+
action: @action,
|
|
40
|
+
args: @args&.map { |a| a.class.name }
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
rescue => e
|
|
44
|
+
# Don't let tracking failures break email delivery
|
|
45
|
+
Rails.logger.error "[ActiveRabbit] Failed to track email_enqueued: #{e.message}" if defined?(Rails) && Rails.logger
|
|
46
|
+
end
|
|
47
|
+
end
|
|
32
48
|
super
|
|
33
49
|
end
|
|
34
50
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerabbit-ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Shapalov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|
|
@@ -81,7 +81,6 @@ files:
|
|
|
81
81
|
- README.md
|
|
82
82
|
- Rakefile
|
|
83
83
|
- TESTING_GUIDE.md
|
|
84
|
-
- activerabbit-ai-0.4.5.gem
|
|
85
84
|
- check_api_data.rb
|
|
86
85
|
- examples/rails_app_testing.rb
|
|
87
86
|
- examples/rails_integration.rb
|
data/activerabbit-ai-0.4.5.gem
DELETED
|
Binary file
|