The request fails with SolidQueue::Job::EnqueueError.
That sounds like a clean failure. The controller returned a 500, so the team expects the order transaction to have rolled back. Instead, the order is present in the primary database, the queue database contains no FulfillOrderJob, and retrying the request collides with the order’s uniqueness constraint.
The code responsible for both writes is short:
class FulfillOrderJob < ApplicationJob
self.enqueue_after_transaction_commit = true
def perform(order_id)
# ...
end
end
Order.transaction do
order = Order.create!(checkout_token: params[:checkout_token])
FulfillOrderJob.perform_later(order.id)
endThe exception did not roll back…








An Abyssinian Blue sits at a laptop, paw on the trackpad planning a dire conspiracy.









