Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,17 @@ jobs:
matrix:
ruby: ['3.3', '3.4', '4.0']
gemfile:
- rails_7_0
- rails_7_1
- rails_7_2
- rails_8_0
- rails_8_1
- rails_main
exclude:
# sqlite3 ~> 1.7 is not compatible with Ruby 3.4+
- gemfile: rails_7_0
ruby: '3.4'
- gemfile: rails_7_1
ruby: '3.4'
- gemfile: rails_7_2
ruby: '3.4'
- gemfile: rails_7_0
ruby: '4.0'
- gemfile: rails_7_1
ruby: '4.0'
- gemfile: rails_7_2
Expand Down Expand Up @@ -67,22 +62,17 @@ jobs:
matrix:
ruby: ['3.3', '3.4', '4.0']
gemfile:
- rails_7_0
- rails_7_1
- rails_7_2
- rails_8_0
- rails_8_1
- rails_main
exclude:
# sqlite3 ~> 1.7 is not compatible with Ruby 3.4+
- gemfile: rails_7_0
ruby: '3.4'
- gemfile: rails_7_1
ruby: '3.4'
- gemfile: rails_7_2
ruby: '3.4'
- gemfile: rails_7_0
ruby: '4.0'
- gemfile: rails_7_1
ruby: '4.0'
- gemfile: rails_7_2
Expand Down Expand Up @@ -127,22 +117,17 @@ jobs:
matrix:
ruby: ['3.3', '3.4', '4.0']
gemfile:
- rails_7_0
- rails_7_1
- rails_7_2
- rails_8_0
- rails_8_1
- rails_main
exclude:
# sqlite3 ~> 1.7 is not compatible with Ruby 3.4+
- gemfile: rails_7_0
ruby: '3.4'
- gemfile: rails_7_1
ruby: '3.4'
- gemfile: rails_7_2
ruby: '3.4'
- gemfile: rails_7_0
ruby: '4.0'
- gemfile: rails_7_1
ruby: '4.0'
- gemfile: rails_7_2
Expand Down
14 changes: 0 additions & 14 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
appraise "rails-7-0" do
gem "rails", "~> 7.0.0"
gem "sqlite3", "~> 1.7"
gem "activerecord-trilogy-adapter"

# Ruby 3.4 drops these default gems
gem "bigdecimal"
gem "drb"
gem "mutex_m"

# Fixes uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
gem "concurrent-ruby", "< 1.3.5"
end

appraise "rails-7-1" do
gem "rails", "~> 7.1.0"
gem "sqlite3", "~> 1.7"
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
### Unreleased

* [Breaking] Drop Rails 7.0 support
* [Bugfix] Action Push Native's push notification class is configured with `config.notification_class` (`config.class` is reserved for overriding the delivery method class)
* `deliver_by` with a duplicate name raises `ArgumentError` instead of `NameError`; `recipients :unknown_method` raises `NoMethodError` instead of silently delivering to nobody
* Slack and Webhook delivery logic is shared between individual and bulk delivery methods via `Noticed::SlackDelivery` and `Noticed::WebhookDelivery`
* `Noticed::EventJob` enqueues delivery jobs in batches with `ActiveJob.perform_all_later` (Rails 7.1+) and loads notifications with `find_in_batches`. Note that `perform_all_later` does not run ActiveJob enqueue callbacks.
* `Noticed::EventJob` enqueues delivery jobs in batches with `ActiveJob.perform_all_later` and loads notifications with `find_in_batches`. Note that `perform_all_later` does not run ActiveJob enqueue callbacks.
* [Bugfix] iOS delivery opens a connection per delivery instead of a shared pool, so `error_handler` runs for the notification actually being delivered and notifiers with different APNs credentials no longer share a connection. The `pool_size` option is removed.
* [Bugfix] FCM only treats a 400 as an invalid token when the error refers to the registration token, so malformed payloads no longer delete valid tokens. The access token is fetched once per delivery.
* Request and response bodies are no longer logged by `post_request` since they can contain credentials and access tokens
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
noticed (3.0.0)
rails (>= 7.0.0)
rails (>= 7.1.0)

GEM
remote: https://rubygems.org/
Expand Down
11 changes: 1 addition & 10 deletions app/jobs/noticed/event_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def perform(event)

# Enqueue individual deliveries in batches so large recipient lists don't load into memory all at once
event.notifications.find_in_batches do |notifications|
enqueue_all notifications.flat_map { |notification| delivery_jobs_for(event, notification) }
ActiveJob.perform_all_later notifications.flat_map { |notification| delivery_jobs_for(event, notification) }
end
end

Expand All @@ -19,14 +19,5 @@ def delivery_jobs_for(event, notification)
deliver_by.job(notification) if deliver_by.perform?(notification)
end
end

# perform_all_later was added in Rails 7.1
def enqueue_all(jobs)
if ActiveJob.respond_to?(:perform_all_later)
ActiveJob.perform_all_later(jobs)
else
jobs.each(&:enqueue)
end
end
end
end
7 changes: 1 addition & 6 deletions app/models/noticed/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ class Event < ApplicationRecord

attribute :params, :json, default: {}

# The coder: keyword was added in Rails 7.1
if Rails.gem_version >= Gem::Version.new("7.1.0.alpha")
serialize :params, coder: Coder
else
serialize :params, Coder
end
serialize :params, coder: Coder
end
end

Expand Down
20 changes: 0 additions & 20 deletions gemfiles/rails_7_0.gemfile

This file was deleted.

Loading
Loading