Pin json gem to ~> 2.3 - #2865
Merged
Merged
Conversation
json 3.0 (pulled in transitively by rubocop's json >= 2.3) made JSON.parse keyword-only. ActiveSupport::JSON.decode passes an options hash positionally, so every session-cookie decryption raises ArgumentError and all specs that touch a session fail. Pinned until Rails supports json 3.x. Also stops Dependabot re-bumping json in the ruby-deps group (ref #2864).
mroderick
marked this pull request as ready for review
September 10, 2026 06:29
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin json gem to ~> 2.3
Why
Dependabot group PR #2864 is red across all six test groups. The PR body lists four gems (haml, image_processing, bullet, webmock), but the lockfile diff contains a fifth, unadvertised change:
json2.21.2 → 3.0.2, a major release pulled in transitively by rubocop'sjson >= 2.3constraint.json 3.0 (released 2026-09-07) made
JSON.parsekeyword-only and now raises on options it doesn't recognise instead of ignoring them. Rails 8.1'sActiveSupport::JSON.decodecalls::JSON.parse(json, options)with a positional hash. Ruby 4.0 cannot promote an empty positional hash to keywords, so json 3.0.2 raises:Every request that reads the encrypted session cookie crashes, which is why the failure signature (
session.key?inApplicationController#current_user) appears in nearly every feature and controller spec.The fix
Pin
json ~> 2.3in the Gemfile. The lockfile resolves back to json 2.21.2 and Dependabot will stop bumping it in the ruby-deps group.Verification
spec/features/member_joining_spec.rb: 4/4 failing with the sameArgumentError).member_joining_spec.rb4 examples, 0 failures.Once Rails supports json 3.x, drop the pin.