rollbar 2.19.3 → 2.19.4

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: 5503cff74b3885c82665a6d7ce5c491be89ba4a66e5176547dbe2249ab1be90b
4
- data.tar.gz: 6cfe51c21ab4bc1ce799b1550f8d2096ed68ac608f41b35fbee170a91d208fd4
3
+ metadata.gz: b47d0c414eae81fc5c56847fad8ebb187b898f53da2877393516a0fce6ba8234
4
+ data.tar.gz: 39e8555260a5c9f166459563d5b23e8c9f70c28fe155daa79e70b04633147024
5
5
  SHA512:
6
- metadata.gz: 63d85d9a87c65605f692ace193e8b1d2da282f73dfb834f38840929cb4d85354212ed0fd9b3d387c31ef8a60a7bf77ec273072b03ac4da645b7c07d118e270a3
7
- data.tar.gz: d7f0973b1f0e6b07fe7f51c08e16e82e35966c575d806c696d40c6b4671786d700d1e121fba63662ccdbddbbf014b3c4fe44af34c1462050c9a8b35cd36aea29
6
+ metadata.gz: 217ebcd88c5e29c08b4003e9cd322cf158864e4e26b16a9b003791df9efb9ade1d23489f5ba586db6ae7f615de25a16209f9052a220e4688cd9abdab6d10e04c
7
+ data.tar.gz: f069f5e44990a8b28d42db5903f16fb785bf0d3296d24069d36879d33caecb2cc25b9f3e4f5b9c29b99b7bcbfcc0fd76a5223807d82a2e16d8394f8ac2ebe0c2
data/Gemfile CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
6
13
 
7
14
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
@@ -47,6 +54,11 @@ elsif RUBY_VERSION.start_with?('2')
47
54
  gem 'sucker_punch', '~> 2.0' # rubocop:disable Bundler/DuplicatedGem
48
55
  end
49
56
 
57
+ unless is_jruby
58
+ # JRuby doesn't support fork, which is required for this test helper.
59
+ gem 'rspec-command'
60
+ end
61
+
50
62
  gem 'aws-sdk-sqs'
51
63
  gem 'database_cleaner'
52
64
  gem 'delayed_job', :require => false
@@ -54,7 +66,6 @@ gem 'generator_spec'
54
66
  gem 'girl_friday', '>= 0.11.1'
55
67
  gem 'redis'
56
68
  gem 'resque', '< 2.0.0'
57
- gem 'rspec-command'
58
69
  gem 'rubocop', :require => false
59
70
  gem 'sinatra'
60
71
  gem 'webmock', :require => false
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
  is_not_jruby = !is_jruby
7
14
 
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -53,10 +60,14 @@ gem 'database_cleaner'
53
60
  gem 'delayed_job', :require => false
54
61
  gem 'generator_spec'
55
62
  gem 'girl_friday', '>= 0.11.1'
56
- gem 'rspec-command'
57
63
  gem 'redis'
58
64
  gem 'resque'
59
65
 
66
+ unless is_jruby
67
+ # JRuby doesn't support fork, which is required for this test helper.
68
+ gem 'rspec-command'
69
+ end
70
+
60
71
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
61
72
  gem 'mime-types', '< 3.0'
62
73
  end
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -54,10 +61,14 @@ gem 'database_cleaner'
54
61
  gem 'delayed_job', :require => false
55
62
  gem 'generator_spec'
56
63
  gem 'girl_friday', '>= 0.11.1'
57
- gem 'rspec-command'
58
64
  gem 'redis'
59
65
  gem 'resque'
60
66
 
67
+ unless is_jruby
68
+ # JRuby doesn't support fork, which is required for this test helper.
69
+ gem 'rspec-command'
70
+ end
71
+
61
72
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
62
73
  gem 'mime-types', '< 3.0'
63
74
  end
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -47,11 +54,15 @@ gem 'codacy-coverage'
47
54
  gem 'delayed_job', :require => false
48
55
  gem 'generator_spec'
49
56
  gem 'girl_friday', '>= 0.11.1'
50
- gem 'rspec-command'
51
57
  gem 'redis'
52
58
  gem 'resque'
53
59
  gem 'simplecov'
54
60
 
61
+ unless is_jruby
62
+ # JRuby doesn't support fork, which is required for this test helper.
63
+ gem 'rspec-command'
64
+ end
65
+
55
66
  gem 'mime-types'
56
67
 
57
68
  gem 'webmock', :require => false
@@ -39,7 +39,7 @@ module Rails
39
39
  end
40
40
 
41
41
  def eval_runner
42
- if Rails.version >= '5.0.0'
42
+ if Rails.version >= '5.1.0'
43
43
  rails5_runner
44
44
  else
45
45
  legacy_runner
@@ -106,25 +106,37 @@ module Rollbar
106
106
  # Ensure all keys are strings since we can receive the payload inline or
107
107
  # from an async handler job, which can be serialized.
108
108
  stringified_payload = Util::Hash.deep_stringify_keys(payload)
109
- result = Truncation.truncate(stringified_payload)
109
+ attempts = []
110
+ result = Truncation.truncate(stringified_payload, attempts)
110
111
 
111
112
  return result unless Truncation.truncate?(result)
112
113
 
113
- handle_too_large_payload(stringified_payload, result)
114
+ handle_too_large_payload(stringified_payload, result, attempts)
114
115
 
115
116
  nil
116
117
  end
117
118
 
118
- def handle_too_large_payload(stringified_payload, final_payload)
119
- original_size = Rollbar::JSON.dump(stringified_payload).bytesize
120
- final_size = final_payload.bytesize
119
+ def handle_too_large_payload(stringified_payload, final_payload, attempts)
121
120
  uuid = stringified_payload['data']['uuid']
122
121
  host = stringified_payload['data'].fetch('server', {})['host']
123
122
 
124
- notifier.send_failsafe("Could not send payload due to it being too large after truncating attempts. Original size: #{original_size} Final size: #{final_size}", nil, uuid, host)
123
+ notifier.send_failsafe(
124
+ too_large_payload_string(stringified_payload, final_payload, attempts),
125
+ nil,
126
+ uuid,
127
+ host
128
+ )
125
129
  logger.error("[Rollbar] Payload too large to be sent for UUID #{uuid}: #{Rollbar::JSON.dump(payload)}")
126
130
  end
127
131
 
132
+ def too_large_payload_string(stringified_payload, final_payload, attempts)
133
+ original_size = Rollbar::JSON.dump(stringified_payload).bytesize
134
+ final_size = final_payload.bytesize
135
+
136
+ 'Could not send payload due to it being too large after truncating attempts. ' \
137
+ "Original size: #{original_size} Attempts: #{attempts.join(', ')} Final size: #{final_size}"
138
+ end
139
+
128
140
  def ignored?
129
141
  data = payload['data']
130
142
 
@@ -15,11 +15,12 @@ module Rollbar
15
15
  StringsStrategy,
16
16
  MinBodyStrategy].freeze
17
17
 
18
- def self.truncate(payload)
18
+ def self.truncate(payload, attempts = [])
19
19
  result = nil
20
20
 
21
21
  STRATEGIES.each do |strategy|
22
22
  result = strategy.call(payload)
23
+ attempts << result.bytesize
23
24
  break unless truncate?(result)
24
25
  end
25
26
 
@@ -6,7 +6,7 @@ module Rollbar
6
6
  class StringsStrategy
7
7
  include ::Rollbar::Truncation::Mixin
8
8
 
9
- STRING_THRESHOLDS = [1024, 512, 256].freeze
9
+ STRING_THRESHOLDS = [1024, 512, 256, 128, 64].freeze
10
10
 
11
11
  def self.call(payload)
12
12
  new.call(payload)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '2.19.3'.freeze
2
+ VERSION = '2.19.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.3
4
+ version: 2.19.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -169,7 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
- rubygems_version: 3.0.1
172
+ rubyforge_project:
173
+ rubygems_version: 2.7.7
173
174
  signing_key:
174
175
  specification_version: 4
175
176
  summary: Reports exceptions to Rollbar