Background
As part of the Rails 8 upgrade (#1015), advancing config.load_defaults to 7.2 adopts the Rails 7.2 default:
active_job.enqueue_after_transaction_commit = :default
With :default, the queue adapter decides whether perform_later is deferred until after the surrounding Active Record transaction commits.
Why this is temporarily overridden
This app uses the :delayed_job adapter in test and production, and :inline in development (config/environments/*.rb). delayed_job stores jobs in the same database as Active Record, so its deferral behaviour under :default differs from adapters that use a separate queue — and development (:inline) differs again.
delayed_job commit-timing is difficult to reproduce faithfully in RSpec (specs typically run inside a rolled-back transaction and/or execute jobs inline), so a regression around enqueue-vs-commit ordering (e.g. a background job reading a record that is not yet committed) would not reliably surface in the suite.
To keep behaviour attributable and matching the pre-7.2 semantics (jobs enqueued immediately, not deferred), we have explicitly pinned:
# config/application.rb
config.active_job.enqueue_after_transaction_commit = :never
Goal
Remove the override and adopt the Rails 7.2 default (:default) once we have validated commit-dependent background jobs behave correctly with delayed_job in a realistic (staging) environment.
Acceptance criteria
Refs #1015
Background
As part of the Rails 8 upgrade (#1015), advancing
config.load_defaultsto7.2adopts the Rails 7.2 default:active_job.enqueue_after_transaction_commit = :defaultWith
:default, the queue adapter decides whetherperform_lateris deferred until after the surrounding Active Record transaction commits.Why this is temporarily overridden
This app uses the
:delayed_jobadapter in test and production, and:inlinein development (config/environments/*.rb). delayed_job stores jobs in the same database as Active Record, so its deferral behaviour under:defaultdiffers from adapters that use a separate queue — and development (:inline) differs again.delayed_job commit-timing is difficult to reproduce faithfully in RSpec (specs typically run inside a rolled-back transaction and/or execute jobs inline), so a regression around enqueue-vs-commit ordering (e.g. a background job reading a record that is not yet committed) would not reliably surface in the suite.
To keep behaviour attributable and matching the pre-7.2 semantics (jobs enqueued immediately, not deferred), we have explicitly pinned:
Goal
Remove the override and adopt the Rails 7.2 default (
:default) once we have validated commit-dependent background jobs behave correctly with delayed_job in a realistic (staging) environment.Acceptance criteria
enqueue_after_transaction_commit = :neveroverride fromconfig/application.rb.Refs #1015