sidekiq-dry 1.1.0 → 1.1.1

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
  SHA256:
3
- metadata.gz: 5449789b83f1e2a3acfd982bd19a9199e04a06805983c7c302b239eb8f93d999
4
- data.tar.gz: 258882b4ccb2b208d910ef4d551bf53492e0c3e1e0025223108b51795fe29b20
3
+ metadata.gz: c64ab9affeebd68fc36380d88605da8f76b7ac92885ae5cbc9173f5120fc7cd8
4
+ data.tar.gz: 40fd08a75380dd98d8f98d712397d1f39f37887b33a07bc21479436fa439d504
5
5
  SHA512:
6
- metadata.gz: 2b69f9b3ebccd8ba6acd3c42fe3a6cefd0fc415d6bd1e0760d0413bb0fc2f4d3aed5f27a45777e2d5fa8b8f451f1934367b6de805a1ea8584d993783dfe3da2d
7
- data.tar.gz: 828522710decd4503892ed336206c4a155195ac07e7935f4a8614c01c6c2929a9bd069424a0c863e8193d52681d8afec65d2f643a2ac86bfc3fd6148812c190d
6
+ metadata.gz: 7d3533a66422beb638e784a45bee9dfffdbd6e1b12e4cc37b9cafbdcf5895a5b86c11e616e4283190f2a640cd27849f7838b17d7921e4b6bd2ae33fef6d37828
7
+ data.tar.gz: be4483f697430720a376f1b1c50dd71efea48072c8be82000828463d6e17d36fc978b146b8cad37303a08e6c3b82c096cb17157f48280a7478c243face90077c
data/CHANGELOG ADDED
@@ -0,0 +1,14 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
4
+
5
+ ## Unreleased
6
+
7
+ ## [1.1.1] - 2020-02-24
8
+
9
+ ### Changed
10
+
11
+ * When an exception is raised, the original (before Dry::Struct deserialization) arguments
12
+ are reset so that other middlewares (think exception reporting) don't have to deal with
13
+ Dry::Struct.
14
+
data/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
  Gem to provide serialization and deserialization of [Dry::Struct][dry-struct]
7
7
  arguments for [Sidekiq][sidekiq] jobs.
8
8
 
9
+ Read more about this gem [here](https://zorbash.com/post/sidekiq-dry/).
10
+
9
11
  ## Rationale
10
12
 
11
13
  **Argument Validation**
@@ -127,7 +129,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
127
129
 
128
130
  ## Contributing
129
131
 
130
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sidekiq-dry. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/sidekiq-dry/blob/master/CODE_OF_CONDUCT.md).
132
+ Bug reports and pull requests are welcome on GitHub at https://github.com/zorbash/sidekiq-dry. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/zorbash/sidekiq-dry/blob/master/CODE_OF_CONDUCT.md).
131
133
 
132
134
 
133
135
  ## License
@@ -6,7 +6,9 @@ module Sidekiq
6
6
  # Middleware which instantiates `Dry::Struct` hash arguments
7
7
  class DeserializationMiddleware
8
8
  def call(_worker, job, _queue)
9
- job['args'].map! do |arg|
9
+ original_args = job['args']
10
+
11
+ job['args'] = job['args'].map do |arg|
10
12
  # Only mutate Dry::Struct hashes
11
13
  next arg unless struct?(arg)
12
14
 
@@ -14,6 +16,14 @@ module Sidekiq
14
16
  end
15
17
 
16
18
  yield
19
+ rescue Exception => _ex
20
+ # Other middlewares will see the Hash arguments
21
+ # which might be handled more predictably in cases
22
+ # like exception tracking where the job arguments
23
+ # commonly get processed to redact sensitive info
24
+ job['args'] = original_args
25
+
26
+ raise
17
27
  end
18
28
 
19
29
  private
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Dry
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-dry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitris Zorbas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-16 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -105,6 +105,7 @@ files:
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
107
  - ".travis.yml"
108
+ - CHANGELOG
108
109
  - CODE_OF_CONDUCT.md
109
110
  - Gemfile
110
111
  - Gemfile.lock