activerabbit-ai 0.5.1 → 0.5.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 +9 -0
- data/README.md +1 -1
- data/lib/active_rabbit/client/configuration.rb +1 -1
- data/lib/active_rabbit/client/dedupe.rb +10 -1
- data/lib/active_rabbit/client/http_client.rb +17 -5
- data/lib/active_rabbit/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d349dcd013eaa9c787d218d695e4e45d779b4c236fc908b84edbda42ac0471b8
|
|
4
|
+
data.tar.gz: 92c559e16a816706558028588f8869212b05e41fb10507d5fc8c40902ca95a62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f26d6cd48e6ba74b87cbdfb5adae1c89dfba13c623c0acfc7418c7061bf3559c66a48061a136a166bdb69a5e06cf1a5d6ee5067c35e20932dd4b98966ad03bcf
|
|
7
|
+
data.tar.gz: daf29ace4927b42c216a8c88df12291f783b599d32a4443e19426854f336c00fb571ae63d2f6003d05707409b150768cc0ed1c42fd12d348e7bb80689a96aabb
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.5.2] - 2025-12-22
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Batch sending resilience**: `HttpClient#post_batch` is now nil-safe and supports both queued items and raw payloads (prevents `undefined method [] for nil` during flush).
|
|
9
|
+
- **Dedupe resilience**: Deduplication key building is now safe when `context` is nil/non-hash.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **Default API URL**: Default `api_url` aligned to `https://app.activerabbit.ai` (dashboard + API host).
|
|
13
|
+
|
|
5
14
|
## [0.5.0] - 2025-12-12
|
|
6
15
|
|
|
7
16
|
### Changed
|
data/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Or install it yourself as:
|
|
|
38
38
|
ActiveRabbit::Client.configure do |config|
|
|
39
39
|
config.api_key = ENV['ACTIVERABBIT_API_KEY']
|
|
40
40
|
config.project_id = ENV['ACTIVERABBIT_PROJECT_ID']
|
|
41
|
-
config.api_url = ENV.fetch('ACTIVERABBIT_API_URL', 'https://
|
|
41
|
+
config.api_url = ENV.fetch('ACTIVERABBIT_API_URL', 'https://app.activerabbit.ai')
|
|
42
42
|
config.environment = Rails.env
|
|
43
43
|
end
|
|
44
44
|
```
|
|
@@ -20,7 +20,7 @@ module ActiveRabbit
|
|
|
20
20
|
attr_accessor :disable_console_logs
|
|
21
21
|
|
|
22
22
|
def initialize
|
|
23
|
-
@api_url = ENV.fetch("ACTIVERABBIT_API_URL", "https://
|
|
23
|
+
@api_url = ENV.fetch("ACTIVERABBIT_API_URL", "https://app.activerabbit.ai")
|
|
24
24
|
@api_key = ENV["ACTIVERABBIT_API_KEY"]
|
|
25
25
|
@project_id = ENV["ACTIVERABBIT_PROJECT_ID"]
|
|
26
26
|
@environment = ENV["ACTIVERABBIT_ENVIRONMENT"] || detect_environment
|
|
@@ -32,7 +32,16 @@ module ActiveRabbit
|
|
|
32
32
|
|
|
33
33
|
def build_key(exception, context)
|
|
34
34
|
top = Array(exception.backtrace).first.to_s
|
|
35
|
-
|
|
35
|
+
ctx = context.is_a?(Hash) ? context : {}
|
|
36
|
+
req = ctx[:request] || ctx["request"]
|
|
37
|
+
req_hash = req.is_a?(Hash) ? req : {}
|
|
38
|
+
|
|
39
|
+
req_id =
|
|
40
|
+
req_hash[:request_id] || req_hash["request_id"] ||
|
|
41
|
+
req_hash[:requestId] || req_hash["requestId"] ||
|
|
42
|
+
ctx[:request_id] || ctx["request_id"] ||
|
|
43
|
+
ctx[:requestId] || ctx["requestId"]
|
|
44
|
+
|
|
36
45
|
[exception.class.name, top, req_id].join("|")
|
|
37
46
|
end
|
|
38
47
|
end
|
|
@@ -77,11 +77,23 @@ module ActiveRabbit
|
|
|
77
77
|
|
|
78
78
|
def post_batch(batch_data)
|
|
79
79
|
# Transform batch data into the format the API expects
|
|
80
|
-
events = batch_data.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
80
|
+
events = Array(batch_data).filter_map do |event|
|
|
81
|
+
next if event.nil?
|
|
82
|
+
|
|
83
|
+
# Support both:
|
|
84
|
+
# - queued items: { method:, path:, data:, timestamp: }
|
|
85
|
+
# - raw payloads: { ...event fields... }
|
|
86
|
+
data =
|
|
87
|
+
(event.is_a?(Hash) ? (event[:data] || event["data"]) : nil) ||
|
|
88
|
+
(event.is_a?(Hash) ? event : nil)
|
|
89
|
+
|
|
90
|
+
next unless data.is_a?(Hash)
|
|
91
|
+
|
|
92
|
+
type =
|
|
93
|
+
data[:event_type] || data["event_type"] ||
|
|
94
|
+
(event.is_a?(Hash) ? (event[:event_type] || event["event_type"] || event[:type] || event["type"]) : nil)
|
|
95
|
+
|
|
96
|
+
{ type: type, data: data }
|
|
85
97
|
end
|
|
86
98
|
|
|
87
99
|
# Send batch to API
|
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.5.
|
|
4
|
+
version: 0.5.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: 2025-12-
|
|
11
|
+
date: 2025-12-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|