Skip to content

solid_queue: type ActiveJob::BatchId#serialize - #1110

Merged
github-actions[bot] merged 1 commit into
ruby:mainfrom
apiology:type-solid-queue-batch-id-serialize
Oct 21, 2026
Merged

github-actions[bot] merged 1 commit into
ruby:mainfrom
apiology:type-solid-queue-batch-id-serialize

Conversation

@apiology

Copy link
Copy Markdown
Contributor

Claude: This PR was written by Claude Code on behalf of @apiology.

Problem

solid_queue 1.7 includes ActiveJob::BatchId into ActiveJob::Base, and its serialize override has no signature, so tools reading this collection lose ActiveJob::Core#serialize's type for every job:

# solid_queue 1.7: lib/active_job/batch_id.rb
module ActiveJob
  module BatchId
    def serialize
      super.tap { |job_data| job_data["batch_id"] = batch_id }
    end
  end
end

MyJob.new.serialize # untyped, instead of Hash[String, untyped]

Solution

Add gems/solid_queue/1.7 declaring ActiveJob::BatchId#serialize with ActiveJob::Core#serialize's type, () -> ::Hash[::String, untyped], with a test.

solid_queue 1.7 includes ActiveJob::BatchId into ActiveJob::Base, and
its serialize override returns super, the Hash ActiveJob::Core#serialize
builds. Without a signature, tools that see the include type
ActiveJob::Base#serialize as untyped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn
@github-actions

Copy link
Copy Markdown

@apiology Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

solid_queue

This RBS files are newly added.

You can merge this PR immediately if the CI passes.
Just comment /merge to merge this PR.

@apiology

Copy link
Copy Markdown
Contributor Author

/merge

@github-actions
github-actions Bot merged commit f837cc3 into ruby:main Oct 21, 2026
7 checks passed
apiology added a commit to iftheshoefritz/solargraph-rails that referenced this pull request Oct 21, 2026
solid_queue 1.7 includes ActiveJob::BatchId into ActiveJob::Base, and
its untyped #serialize shadows ActiveJob::Core#serialize, so
ActiveJob::Base#serialize resolves to undefined on Rails 8.

ruby/gem_rbs_collection#1110 adds gems/solid_queue/1.7, typing
BatchId#serialize as Hash[String, untyped]. Pin the collection to its
merge commit so ActiveJob::Base#serialize resolves to
Hash{String => undefined} again.


Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant