activerabbit-ai 0.6.0 → 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
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,26 @@
|
|
|
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
|
+
|
|
20
|
+
## [0.6.1] - 2026-01-09
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **Docker/Production path detection**: Fixed `in_app_frame?` to correctly detect app frames in Docker containers and production environments with absolute paths like `/app/app/controllers/...`
|
|
24
|
+
|
|
5
25
|
## [0.6.0] - 2026-01-09
|
|
6
26
|
|
|
7
27
|
### Added
|
|
@@ -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
|
|
@@ -156,16 +156,30 @@ module ActiveRabbit
|
|
|
156
156
|
def in_app_frame?(file)
|
|
157
157
|
return false if blank?(file)
|
|
158
158
|
|
|
159
|
-
#
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
# Exclude gem/library paths first (these are never in-app)
|
|
160
|
+
return false if file.include?("/gems/")
|
|
161
|
+
return false if file.include?("/bundle/")
|
|
162
|
+
return false if file.include?("/.bundle/")
|
|
163
|
+
return false if file.include?("/rubygems/")
|
|
164
|
+
# Exclude Ruby stdlib but not app paths that happen to have "ruby" in them
|
|
165
|
+
return false if file =~ %r{/ruby/\d+\.\d+\.\d+/}
|
|
166
|
+
|
|
167
|
+
# In-app patterns (common Rails app structures)
|
|
168
|
+
# Relative paths
|
|
169
|
+
return true if file.start_with?("app/")
|
|
170
|
+
return true if file.start_with?("lib/")
|
|
171
|
+
return true if file.start_with?("config/")
|
|
172
|
+
|
|
173
|
+
# Absolute paths in Docker/production (e.g., /app/app/controllers/...)
|
|
174
|
+
# Match paths that contain /app/ followed by typical app directories
|
|
175
|
+
return true if file =~ %r{/app/(controllers|models|services|jobs|views|helpers|mailers|workers|channels)/}
|
|
176
|
+
return true if file =~ %r{/lib/[^/]+\.rb$}
|
|
177
|
+
return true if file =~ %r{/config/}
|
|
178
|
+
|
|
179
|
+
# Generic: path contains /app/ but not in excluded paths (already checked above)
|
|
180
|
+
return true if file.include?("/app/") && file.end_with?(".rb")
|
|
181
|
+
|
|
182
|
+
false
|
|
169
183
|
end
|
|
170
184
|
|
|
171
185
|
def classify_frame(file)
|
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
|