appsignal 3.0.24-java → 3.0.25-java
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 +6 -0
- data/lib/appsignal/transaction.rb +1 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +1 -1
- data/spec/lib/appsignal/transaction_spec.rb +21 -2
- data/spec/support/helpers/activejob_helpers.rb +1 -1
- data/spec/support/helpers/dependency_helper.rb +8 -0
- 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: deaef7e2168cb358393f26888084c1ea47efd1a370022a74a751c12b3d2a5f05
|
4
|
+
data.tar.gz: b8df7d9e2c01c03797a17e253dcb1cd54ed5df50b533deb4a91e94c5cdf7a3f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f760735aa2fffb0680e00f5b8bc771a9d6ff22bcdb4e13f7bbba0753ae5390ac35d6b9ecc49a388e3290ad2d53fe392e5f5b9a1fc73d1c6f6a52887f93a6ccbc
|
7
|
+
data.tar.gz: 17ff605c14abb3363494062533d33d52f0c64b53c01e9f8a700ecf8d8d22dcdb5f0e55b2be6db9a34b1233d9b2da65dc85ce9227df8d148d49dd5d33492686f8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 3.0.25
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- [399cf790](https://github.com/appsignal/appsignal-ruby/commit/399cf79044e7c8936ab72dce420d91af4cb71d16) patch - Sanitize `ActiveRecord::RecordNotUnique` error messages to not include any database values that is not unique in the database. This ensures no personal information is sent to AppSignal through error messages from this error.
|
8
|
+
|
3
9
|
## 3.0.24
|
4
10
|
|
5
11
|
### Changed
|
@@ -537,7 +537,7 @@ module Appsignal
|
|
537
537
|
# Returns an unchanged message otherwise.
|
538
538
|
def cleaned_error_message(error)
|
539
539
|
case error.class.to_s
|
540
|
-
when "PG::UniqueViolation"
|
540
|
+
when "PG::UniqueViolation", "ActiveRecord::RecordNotUnique"
|
541
541
|
error.message.to_s.gsub(/\)=\(.*\)/, ")=(?)")
|
542
542
|
else
|
543
543
|
error.message.to_s
|
data/lib/appsignal/version.rb
CHANGED
@@ -376,7 +376,7 @@ if DependencyHelper.active_job_present?
|
|
376
376
|
]
|
377
377
|
end
|
378
378
|
let(:expected_wrapped_args) do
|
379
|
-
if
|
379
|
+
if DependencyHelper.active_job_wraps_args?
|
380
380
|
[{
|
381
381
|
"_aj_ruby2_keywords" => ["args"],
|
382
382
|
"args" => expected_args
|
@@ -1350,8 +1350,8 @@ describe Appsignal::Transaction do
|
|
1350
1350
|
end
|
1351
1351
|
|
1352
1352
|
context "with a PG::UniqueViolation" do
|
1353
|
-
|
1354
|
-
|
1353
|
+
before do
|
1354
|
+
stub_const("PG::UniqueViolation", Class.new(StandardError))
|
1355
1355
|
end
|
1356
1356
|
|
1357
1357
|
let(:error) do
|
@@ -1364,6 +1364,25 @@ describe Appsignal::Transaction do
|
|
1364
1364
|
expect(subject).to eq "ERROR: duplicate key value violates unique constraint \"index_users_on_email\" DETAIL: Key (email)=(?) already exists."
|
1365
1365
|
end
|
1366
1366
|
end
|
1367
|
+
|
1368
|
+
context "with a ActiveRecord::RecordNotUnique" do
|
1369
|
+
before do
|
1370
|
+
stub_const("ActiveRecord::RecordNotUnique", Class.new(StandardError))
|
1371
|
+
end
|
1372
|
+
|
1373
|
+
let(:error) do
|
1374
|
+
ActiveRecord::RecordNotUnique.new(
|
1375
|
+
"PG::UniqueViolation: ERROR: duplicate key value violates unique constraint \"example_constraint\"\n" \
|
1376
|
+
"DETAIL: Key (email)=(foo@example.com) already exists."
|
1377
|
+
)
|
1378
|
+
end
|
1379
|
+
|
1380
|
+
it "returns a sanizited error message" do
|
1381
|
+
expect(subject).to eq \
|
1382
|
+
"PG::UniqueViolation: ERROR: duplicate key value violates unique constraint \"example_constraint\"\n" \
|
1383
|
+
"DETAIL: Key (email)=(?) already exists."
|
1384
|
+
end
|
1385
|
+
end
|
1367
1386
|
end
|
1368
1387
|
|
1369
1388
|
describe ".to_hash / .to_h" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ActiveJobHelpers
|
2
2
|
def active_job_args_wrapper(args: [], params: nil)
|
3
|
-
if
|
3
|
+
if DependencyHelper.active_job_wraps_args?
|
4
4
|
wrapped_args = {}
|
5
5
|
|
6
6
|
if params
|
@@ -29,10 +29,18 @@ module DependencyHelper
|
|
29
29
|
rails_present? && rails_version >= Gem::Version.new("6.1.0")
|
30
30
|
end
|
31
31
|
|
32
|
+
def rails6_1_5_present?
|
33
|
+
rails_present? && rails_version >= Gem::Version.new("6.1.5")
|
34
|
+
end
|
35
|
+
|
32
36
|
def rails7_present?
|
33
37
|
rails_present? && rails_version >= Gem::Version.new("7.0.0")
|
34
38
|
end
|
35
39
|
|
40
|
+
def active_job_wraps_args?
|
41
|
+
rails7_present? || (ruby_3_1_or_newer? && rails6_1_present? && !rails6_1_5_present?)
|
42
|
+
end
|
43
|
+
|
36
44
|
def rails_version
|
37
45
|
Gem.loaded_specs["rails"].version
|
38
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.25
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|