Skip to content

Prevent JSON 3.0 from breaking solidus_admin when using Rails 8.0 - #6588

Merged
AlistairNorman merged 1 commit into
solidusio:mainfrom
SuperGoodSoft:supergood/fix-json-activesupport-incompatibility
Sep 8, 2026
Merged

AlistairNorman merged 1 commit into
solidusio:mainfrom
SuperGoodSoft:supergood/fix-json-activesupport-incompatibility

Conversation

@Noah-Silvera

@Noah-Silvera Noah-Silvera commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

In JSON 3.0.0, passing the quirks_mode keyword to methods was changed from a silent failure to a loud failure -
ruby/json@ebf0f29

The use of the JSON quirks_mode was removed from rails in v8.1.0

rails/rails@646f174#diff-c202bc84686ddd83549f9603008d8fb9f394a05e76393ff160b7c9494165fc4a

JSON 3.0.0 was released on September 7th.

A few solidus dependencies require json, and none limit major version upgrades, so new bundle operations (such as recreating the sandbox in docker) would resolve to a JSON version >3

However, our rails version is pinned to 8.0.0 in the docker compose, and attempting to upgrade to 8.1+ in the docker compose results in a failed sandbox creation.

This means we resolve to a active support version < 8.1 that still uses quirks_mode, but a JSON version > 3 which makes using quirks_mode an error that fails loudly.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@Noah-Silvera

Copy link
Copy Markdown
Contributor Author

Weird... Rails 8.1 is supported

But I can't update RAILS_VERSION in the docker compose file to 8.1+ and have it resolve the gems.

More investigation needed

@Noah-Silvera

Copy link
Copy Markdown
Contributor Author

cc: @AlistairNorman this is an interesting problem. I think Rails 8.0.0 + Solidus + JSON 3.0 is an unsupported combo now regardless

Claude suggested this possible solution too but we need to test it better

  installed_rails_version = Gem::Specification.find_all_by_name("rails").map(&:version).max

  s.add_dependency "blueprinter"
  s.add_dependency "geared_pagination", "~> 1.1"
  # Rails < 8.1 isn't compatible with json 3.x
  s.add_dependency "json", "< 3" if installed_rails_version && installed_rails_version < Gem::Version.new("8.1")

@Noah-Silvera Noah-Silvera changed the title Prevent solidus_admin from breaking while Rails 8.1 is still unsupported Prevent solidus_admin from breaking in Rails 8.0 Sep 8, 2026
@Noah-Silvera Noah-Silvera changed the title Prevent solidus_admin from breaking in Rails 8.0 Prevent JSON 3.0 from breaking solidus_admin when using Rails 8.0 Sep 8, 2026
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (98c4b00) to head (459445b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #6588    +/-   ##
========================================
  Coverage   92.26%   92.26%            
========================================
  Files         995     1037    +42     
  Lines       20453    21241   +788     
========================================
+ Hits        18870    19598   +728     
- Misses       1583     1643    +60     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benjaminwil

Copy link
Copy Markdown
Contributor

Just a small note for context: CI/CD is failing the Dummy App workflow because of this issue.

@AlistairNorman
AlistairNorman force-pushed the supergood/fix-json-activesupport-incompatibility branch from efc4c49 to 3b401ff Compare September 8, 2026 21:20
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Sep 8, 2026
@AlistairNorman

Copy link
Copy Markdown
Contributor

I added this to the core gemspec as well to fix the dummy app and solidus install runs. According to this issue 8.1 also has issues with json 3 so it makes sense to just pin it to less than 3 for now and we can do that upgrade when all of the issues have been sorted out.

Comment on lines 32 to +34
s.add_dependency "geared_pagination", "~> 1.1"
# Rails < 8.1 isn't compatible with json 3.x
s.add_dependency "json", "< 3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is necessary since solidus_admin depends on solidus_core.

In JSON 3.0.0, passing the `quirks_mode` keyword to methods was changed
from a silent failure to a loud failure -
ruby/json@ebf0f29

The use of the JSON `quirks_mode` was removed from rails in v8.1.0,
however there is still another incompatibility between Rails 8.1 and
JSON 3.

rails/rails@646f174#diff-c202bc84686ddd83549f9603008d8fb9f394a05e76393ff160b7c9494165fc4a

This is a temporary fix to stop JSON from resolving to 3 until JSON and
Rails resolve their compatibility issues.

Co-Authored-By: Adam Mueller <adam@super.gd>
Co-Authored-By: Alistair Norman <alistair@super.gd>
@AlistairNorman
AlistairNorman force-pushed the supergood/fix-json-activesupport-incompatibility branch from 3b401ff to 459445b Compare September 8, 2026 21:44
@AlistairNorman
AlistairNorman marked this pull request as ready for review September 8, 2026 21:44
@AlistairNorman
AlistairNorman requested a review from a team as a code owner September 8, 2026 21:44
@AlistairNorman
AlistairNorman merged commit 6692e51 into solidusio:main Sep 8, 2026
43 of 44 checks passed
@jarednorman

Copy link
Copy Markdown
Member

Just for transparency/posterity: this was erroneously merged by someone outside core before getting two core team approvals. Oopsy.

@jarednorman
jarednorman deleted the supergood/fix-json-activesupport-incompatibility branch September 9, 2026 00:00
@tvdeyen

tvdeyen commented Sep 9, 2026

Copy link
Copy Markdown
Member

Just for transparency/posterity: this was erroneously merged by someone outside core before getting two core team approvals. Oopsy.

Thanks. I think thats fine. It unblocks lots of other work and does not introduce a new feature. The rule should not be handled that strictly IMO, especially if it's tidying the ecosystem. Keep up the good work @AlistairNorman

@benjaminwil

Copy link
Copy Markdown
Contributor

Could we also backport this change into the next patch releases? I think json v3 may end up confusing some users who are just setting up Solidus for the first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants