airbrake-ruby 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c6bcda11cc4df213ee240b89afd624859204780
4
- data.tar.gz: 50f609e5e47c2129750b43f7f98bebf13794ef52
3
+ metadata.gz: 468e348697a972a35ec849945767df8b9f41f46a
4
+ data.tar.gz: 3e419d4cf9bb00c0ecfb64aa5bac605d2d8ecb82
5
5
  SHA512:
6
- metadata.gz: daa0b464c5ca8818a006e0a10cec1ff185ffbf2b3602b0b57f1fda4b69032e17d3dbb512054b5a89a15ef0571d698526570c4a8c538c2d7ee1120b1b58158b9c
7
- data.tar.gz: 845cd20d7caf62ab809db418cc38178e4dbf257e3436181250ffc14af851087be444315cd0af26830f0b3223e09df8d7a99aeaacc386d13b408766d62f621768
6
+ metadata.gz: 0debe52953f21f4af23a04895eaaffb9f48a1eb5aa04a32ec58a26a542799cb3411e15f2f8e54d0514f58b861eba889f3d4e013ff28405c1b2144c73a036d815
7
+ data.tar.gz: c552c5522d8d53e66f17322da98650ffb3e155dca191161fbeae2efecce9052092e1ca9808f7798f30593f7750984d9f6d2ec179d89ed8b47318f2ce1a003e6a
@@ -21,6 +21,12 @@ module Airbrake
21
21
  Numeric
22
22
  ].freeze
23
23
 
24
+ ##
25
+ # Variables starting with this prefix are not attached to a notice.
26
+ # @see https://github.com/airbrake/airbrake-ruby/issues/229
27
+ # @return [String]
28
+ IGNORE_PREFIX = '_'.freeze
29
+
24
30
  def initialize
25
31
  @weight = 110
26
32
  end
@@ -51,12 +57,14 @@ module Airbrake
51
57
 
52
58
  def thread_variables(th)
53
59
  th.thread_variables.map.with_object({}) do |var, h|
60
+ next if var.to_s.start_with?(IGNORE_PREFIX)
54
61
  h[var] = sanitize_value(th.thread_variable_get(var))
55
62
  end
56
63
  end
57
64
 
58
65
  def fiber_variables(th)
59
66
  th.keys.map.with_object({}) do |key, h|
67
+ next if key.to_s.start_with?(IGNORE_PREFIX)
60
68
  h[key] = sanitize_value(th[key])
61
69
  end
62
70
  end
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.2.5'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.2.6'.freeze
8
8
  end
@@ -119,6 +119,18 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
119
119
  )
120
120
  end
121
121
  end
122
+
123
+ it "ignores thread variables starting with an underscore" do
124
+ var = :__recursive_key__
125
+
126
+ new_thread do |th|
127
+ th.thread_variable_set(var, :bingo)
128
+ subject.call(notice)
129
+ end
130
+
131
+ thread_variables = notice[:params][:thread][:thread_variables]
132
+ expect(thread_variables).to be_nil
133
+ end
122
134
  end
123
135
 
124
136
  describe "fiber variables" do
@@ -254,4 +266,16 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
254
266
  subject.call(notice)
255
267
  expect(notice[:params][:thread][:safe_level]).to eq(0)
256
268
  end
269
+
270
+ it "ignores fiber variables starting with an underscore" do
271
+ key = :__recursive_key__
272
+
273
+ new_thread do |th|
274
+ th[key] = :bingo
275
+ subject.call(notice)
276
+ end
277
+
278
+ fiber_variables = notice[:params][:thread][:fiber_variables]
279
+ expect(fiber_variables[key]).to be_nil
280
+ end
257
281
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec