coil 1.5.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb9891f8607d9006f5b72a07e88725a18e57dd6ea8a22c7c610eb9e490557983
4
- data.tar.gz: eac76e2c7a1a1c3f3697613a637fa939b11ecb588e65dd828cb4ddd2f7b1137f
3
+ metadata.gz: 5bc87488bb14278757b74fb9c539532de36faf3b346adee293b4abb2fa0517be
4
+ data.tar.gz: cfe37adfede162efa3c9d09fa2db7178f982021a137d0a0452960424509af318
5
5
  SHA512:
6
- metadata.gz: 0c23e1a776d61ce557f1ace11aac2dc29fc71ee87a4dfd8037bb50266bdbb1254d87d5e1a3870f1622f9aa7837719e0608a89f0162da0f6c55e64a7adaa21341
7
- data.tar.gz: 961ef82b7218976a207cf06af86ca2e7339fc31d255a6d1aaf8d80bf762436afe88e43af3dc0f27e69950fe0d5cb4abdfd5350bc17596aa05000d85b5878cc83
6
+ metadata.gz: 97a4c9aa3de126d9f45fcc45a08705ca812d29b56a97d0a4f4b2354d93839a14ba32cd58a3af60b4cbd0b44fe8487171a87870ab0fc694b165c13b33d36e7a36
7
+ data.tar.gz: 37b3e67312ad0cf58636dcbe35eab8937ab9c2daf3b92aa74284480a02ede5e7886e8f71556143dd9617533c3f92c1f703bb82f5638f7dd107a763727bab3427
data/CHANGELOG.md ADDED
@@ -0,0 +1,61 @@
1
+ ## main
2
+
3
+ ## [1.5.2](https://github.com/OdekoTeam/coil/compare/1.5.1...1.5.2) (2025-03-19)
4
+ #### Fixed
5
+ - Fix support for Rails versions older than 6.1.0 ([0afd25b](https://github.com/OdekoTeam/coil/commit/0afd25bf1f47371e47f3787daf81caab8b676646))
6
+
7
+ ## [1.5.1](https://github.com/OdekoTeam/coil/compare/1.5.0...1.5.1) (2025-01-29)
8
+ #### Fixed
9
+ - Avoid `ActiveRecord::SubclassNotFound` on orphaned messages ([ea3a64a](https://github.com/OdekoTeam/coil/commit/ea3a64acfcb9f05d53e242f96eb1b525761e414d))
10
+
11
+ ## [1.5.0](https://github.com/OdekoTeam/coil/compare/1.4.0...1.5.0) (2025-01-29)
12
+ #### Added
13
+ - Periodic cleanup jobs ([0e784b3](https://github.com/OdekoTeam/coil/commit/0e784b3684b8e12677e6d05bc0a7762e254e6357))
14
+ - jobs: `Coil::Inbox::MessagesCleanupJob`, `Coil::Outbox::MessagesCleanupJob`
15
+ - configuration settings: `Coil.inbox_retention_period`, `Coil.outbox_retention_period`
16
+ - **NOTE**: this release includes additional migrations, so **be sure to run** `bundle exec rails coil:install:migrations db:migrate`
17
+
18
+ ## [1.4.0](https://github.com/OdekoTeam/coil/compare/1.3.3...1.4.0) (2024-12-11)
19
+ #### Added
20
+ - `Coil.sidekiq_queue` configuration setting ([15fb072](https://github.com/OdekoTeam/coil/commit/15fb072284bad1eeb5661d3b037d3e07bb46c59a))
21
+ #### Fixed
22
+ - Redundant variable in test ([cd41472](https://github.com/OdekoTeam/coil/commit/cd414726298ce80153f508f755bedd371bbb8dab))
23
+
24
+ ## [1.3.3](https://github.com/OdekoTeam/coil/compare/1.3.2...1.3.3) (2024-10-25)
25
+ #### Changed
26
+ - Documentation ([b25f00c](https://github.com/OdekoTeam/coil/commit/b25f00c19dfdb4cd3653ce715ace0be3145046e9))
27
+
28
+ ## [1.3.2](https://github.com/OdekoTeam/coil/compare/1.3.1...1.3.2) (2024-10-24)
29
+ #### Fixed
30
+ - Build warnings ([f1c1145](https://github.com/OdekoTeam/coil/commit/f1c11459b5b54567c0b267ae6279f776ec33a680))
31
+
32
+ ## [1.3.1](https://github.com/OdekoTeam/coil/compare/1.3.0...1.3.1) (2024-10-22)
33
+ #### Added
34
+ - CI publish to RubyGems.org ([cbc46bb](https://github.com/OdekoTeam/coil/commit/cbc46bbc153d1a7fa9d51dbf134dabe894cd594d))
35
+
36
+ ## [1.3.0](https://github.com/OdekoTeam/coil/compare/1.2.1...1.3.0) (2024-10-22)
37
+ #### Added
38
+ - License ([caf8a2f](https://github.com/OdekoTeam/coil/commit/caf8a2ff68672f434eeb092e876bb6df8852b6b1))
39
+ #### Changed
40
+ - CI Docker registry ([1a2586d](https://github.com/OdekoTeam/coil/commit/1a2586db9541134c1e433d112591457a6ee9edc0))
41
+
42
+ ## [1.2.1](https://github.com/OdekoTeam/coil/compare/1.2.0...1.2.1) (2024-07-01)
43
+ #### Fixed
44
+ - `next_message` race condition ([eb43a90](https://github.com/OdekoTeam/coil/commit/eb43a900c2db4300fc41c6c874aca66868039718))
45
+
46
+ ## [1.2.0](https://github.com/OdekoTeam/coil/compare/1.0.1...1.2.0) (2024-06-10)
47
+ #### Added
48
+ - `around_process` job method ([46d3d5b](https://github.com/OdekoTeam/coil/commit/46d3d5b53f6dd066d5add024f39120c6140c14f3))
49
+ #### Fixed
50
+ - type aliases documentation ([d5da8d1](https://github.com/OdekoTeam/coil/commit/d5da8d13de6ac6fa9df6ba7c281db86090358f7f))
51
+
52
+ ## [1.0.1](https://github.com/OdekoTeam/coil/compare/1.0.0...1.0.1) (2024-06-07)
53
+ #### Fixed
54
+ - `QueueLocking` documentation ([285a5cb](https://github.com/OdekoTeam/coil/commit/285a5cb13bffa3b824c54b59c02be2bbad93bef4))
55
+ - Support for older Rails and Sidekiq versions ([2051243](https://github.com/OdekoTeam/coil/commit/205124313b75feaf42aac10aa7455bc54a2394f0))
56
+ #### Changed
57
+ - CI Docker image ([4da1d3f](https://github.com/OdekoTeam/coil/commit/4da1d3ffdf8bb8fe03d14466ae26640159942bca))
58
+
59
+ ## 1.0.0 (2024-06-06)
60
+ #### Added
61
+ - First release
@@ -93,7 +93,11 @@ module Coil
93
93
  end
94
94
 
95
95
  def message_class_for(type)
96
- message_parent_class.sti_class_for(type)
96
+ if ActiveRecord.version < Gem::Version.new("6.1.0")
97
+ message_parent_class.send(:find_sti_class, type)
98
+ else
99
+ message_parent_class.sti_class_for(type)
100
+ end
97
101
  rescue ActiveRecord::SubclassNotFound
98
102
  end
99
103
 
@@ -12,9 +12,10 @@ module Coil
12
12
  # the distinct keys for which we have unprocessed messages (excluding
13
13
  # very recent messages, since a TransactionalMessagesJob may still be
14
14
  # processing those). Then, enqueue the necessary jobs for those keys.
15
- message_parent_class.select(:type).distinct.each do |x|
16
- message_class = x.class
17
- job_class = x.job_class
15
+ message_parent_class.select(:type).distinct.pluck(:type).each do |type|
16
+ message_class = message_class_for(type)
17
+ next unless message_class.present?
18
+ job_class = message_class.new.job_class
18
19
 
19
20
  message_class
20
21
  .unprocessed(processor_name: job_class.name)
@@ -27,6 +28,15 @@ module Coil
27
28
 
28
29
  private
29
30
 
31
+ def message_class_for(type)
32
+ if ActiveRecord.version < Gem::Version.new("6.1.0")
33
+ message_parent_class.send(:find_sti_class, type)
34
+ else
35
+ message_parent_class.sti_class_for(type)
36
+ end
37
+ rescue ActiveRecord::SubclassNotFound
38
+ end
39
+
30
40
  def message_parent_class
31
41
  end
32
42
  end
data/lib/coil/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Coil
5
- VERSION = "1.5.0"
5
+ VERSION = "1.5.2"
6
6
  end
data/rbi/coil.rbi CHANGED
@@ -378,6 +378,9 @@ class Coil::TransactionalMessagesPeriodicJob < ::Coil::ApplicationJob
378
378
 
379
379
  private
380
380
 
381
+ sig { params(type: String).returns(T.nilable(::Coil::AnyMessageClass)) }
382
+ def message_class_for(type); end
383
+
381
384
  sig { abstract.returns(::Coil::AnyMessageClass) }
382
385
  def message_parent_class; end
383
386
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Brennan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-01-29 00:00:00.000000000 Z
12
+ date: 2025-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -249,6 +249,7 @@ executables: []
249
249
  extensions: []
250
250
  extra_rdoc_files: []
251
251
  files:
252
+ - CHANGELOG.md
252
253
  - LICENSE
253
254
  - README.md
254
255
  - Rakefile
@@ -286,7 +287,10 @@ files:
286
287
  homepage: https://github.com/OdekoTeam/coil
287
288
  licenses:
288
289
  - Apache-2.0
289
- metadata: {}
290
+ metadata:
291
+ bug_tracker_uri: https://github.com/OdekoTeam/coil/issues
292
+ changelog_uri: https://github.com/OdekoTeam/coil/blob/main/CHANGELOG.md
293
+ source_code_uri: https://github.com/OdekoTeam/coil
290
294
  post_install_message:
291
295
  rdoc_options: []
292
296
  require_paths: