Skip to content

Commit 7d2202f

Browse files
committed
ci: pin json 2 for Rails before 8.1
The compatibility matrix runs bundle lock --update. On October 3 it still resolved json 2.21.2, because rubocop 1.88.2 and standard 1.56.0 held json below 3. rubocop 1.91.0 and standard 1.57.0 allow json 3, so the matrix now resolves json 3.0.2, and every Rails 7.1, 7.2, and 8.0 job fails with "unknown keyword: quirks_mode". main fails the same way today. The break is in Active Support, not in Solid Objects. Local checks with json 3.0.2 show that Active Support 7.1.6 and 8.0.5.1 fail to encode and decode, 8.1.3.1 fails to decode, and only 8.1.4 works. An application on those Rails lines must pin json 2.x, so the matrix now pins it too and tests the configuration that the guide prescribes. The Rails 7.1 suite passes with the pin: 873 runs, 0 failures. Correct the json note in docs/operations.md, docs/agents.md, the quickstart README, and context7.json. The earlier note named only the 8.1 releases before 8.1.4.
1 parent 143297c commit 7d2202f

6 files changed

Lines changed: 40 additions & 26 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
hold once. The check also fails when a `TicketSale` sample in the README or
2727
in `docs/` differs from the actor that it runs. A new `quickstart` CI job runs
2828
the check, and the release job waits for it.
29-
- Correct the `json` 3.0.2 note in `docs/operations.md`. Only Active Support
30-
8.1.3.1 and earlier 8.1 releases fail with it; Active Support 8.1.4 decodes
31-
correctly. Upgrade Rails, or pin `json` to 2.x when an upgrade is not
32-
possible.
29+
- Correct the `json` 3.x note in `docs/operations.md`. The `json` gem 3.x works
30+
only with Active Support 8.1.4 or newer. Active Support 7.1, 7.2, and 8.0
31+
raise `unknown keyword: quirks_mode`, and Active Support 8.1.3.1 and earlier
32+
8.1 releases fail to decode. Upgrade Rails to 8.1.4 or newer, or pin `json`
33+
to 2.x. The compatibility CI matrix now pins `json` 2.x for Rails 7.1, 7.2,
34+
and 8.0, the configuration that the guide prescribes.
3335

3436
## 0.17.0 - 2026-10-03
3537

‎Gemfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if rails_version
1010
%w[actioncable actionpack actionview activerecord activesupport railties].each do |library|
1111
gem library, constraint
1212
end
13+
gem "json", "~> 2" if Gem::Version.new(rails_version) < Gem::Version.new("8.1")
1314
end
1415

1516
group :development, :test do

‎context7.json‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22
"$schema": "https://context7.com/schema/context7.json",
33
"projectTitle": "Solid Objects for Rails (solid_objects)",
44
"description": "SQL-backed virtual actor library for Ruby on Rails. Actors have stable identities, durable JSON state in SQLite, PostgreSQL, or MySQL, ordered per-identity mailboxes, fenced activation, durable reminders, and transactional effects. Requires Ruby 3.3+ and Rails 7.1+.",
5-
"folders": ["docs", "examples"],
6-
"excludeFolders": ["./docs/adr", "./docs/research"],
7-
"excludeFiles": ["AGENTS.md", "CLAUDE.md", "CONTRIBUTING.md", "implementation-plan.md"],
5+
"folders": [
6+
"docs",
7+
"examples"
8+
],
9+
"excludeFolders": [
10+
"./docs/adr",
11+
"./docs/research"
12+
],
13+
"excludeFiles": [
14+
"AGENTS.md",
15+
"CLAUDE.md",
16+
"CONTRIBUTING.md",
17+
"implementation-plan.md"
18+
],
819
"rules": [
920
"Solid Objects requires Rails 7.1 or newer and Ruby 3.3 or newer. It is a Rails engine, not a framework-independent Ruby library.",
1021
"Install with bundle add solid_objects, bin/rails generate solid_objects:install, bin/rails db:migrate, and bin/rails solid_objects:doctor.",
22+
"The json gem 3.x works only with Active Support 8.1.4 or newer. On Rails 7.1, 7.2, 8.0, or 8.1 before 8.1.4, pin gem \"json\", \"~> 2\".",
1123
"The generated authorization policies deny every operation. Production policies must bind the actor type and ID to the authenticated user or tenant, and callers pass authorization_context:.",
1224
"Run bundle exec solid_objects start for reminders, async calls, effects, and broadcasts. Direct synchronous calls do not need it.",
1325
"Delivery is at least once. Effect handlers registered with SolidObjects.register_effect must use context.id as the idempotency key.",

‎docs/agents.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ bin/rails solid_objects:doctor
6464
The generator adds an initializer and copies migrations into the application.
6565
The doctor checks the configuration, the tables, and one real actor round trip.
6666

67-
If the doctor or an actor call fails with
68-
`ArgumentError: wrong number of arguments (given 2, expected 1)` from
69-
`ActiveSupport::JSON.decode`, the application has Active Support 8.1.3.1 or
70-
earlier with `json` 3.0.2. Upgrade Rails to 8.1.4 or newer. If you cannot
71-
upgrade, pin `gem "json", "~> 2"` in the `Gemfile`.
67+
The `json` gem 3.x works only with Active Support 8.1.4 or newer. On Rails
68+
7.1, 7.2, 8.0, or 8.1 before 8.1.4, pin `gem "json", "~> 2"` in the
69+
`Gemfile`. Without the pin, Active Support raises an `ArgumentError`, such as
70+
`unknown keyword: quirks_mode`, for every JSON column.
7271

7372
[Installing and upgrading](operations.md#installing-and-upgrading) has the
7473
details.
@@ -238,7 +237,7 @@ runs checks 2 and 4 against a new Rails application.
238237
| `SolidObjects::SyncTimeout` | The call did not finish in time. The message is still durable. Use its `message_reference` to wait for the result |
239238
| `SolidObjects::ApplicationWriteForbidden` | A handler wrote a model directly. Use `commit_action` or `emit` |
240239
| `SolidObjects::Rejected` | The actor called `reject`. This is a business result, not a retry |
241-
| `ArgumentError` from `ActiveSupport::JSON.decode` | Upgrade Rails to 8.1.4 or newer, or pin `gem "json", "~> 2"` |
240+
| `ArgumentError` from `ActiveSupport::JSON`, such as `unknown keyword: quirks_mode` | `json` 3.x with Active Support before 8.1.4. Upgrade Rails to 8.1.4 or newer, or pin `gem "json", "~> 2"` |
242241

243242
## 11. Guarantees to state correctly
244243

‎docs/operations.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ reports a failed or warned check rather than raising out of the command.
2626
## Installing and upgrading
2727

2828
Solid Objects keeps actor state, message arguments, results, and the remembered
29-
idempotency keys in JSON columns. Active Support decodes every one of them.
30-
Active Support 8.1.3.1 and earlier 8.1 releases fail with the `json` gem at
31-
3.0.2. `ActiveSupport::JSON.decode` raises:
29+
idempotency keys in JSON columns. Active Support encodes and decodes every one
30+
of them. The `json` gem 3.x works only with Active Support 8.1.4 or newer:
3231

33-
```
34-
ArgumentError: wrong number of arguments (given 2, expected 1)
35-
```
32+
- Active Support 7.1, 7.2, and 8.0 raise
33+
`ArgumentError: unknown keyword: quirks_mode` when they encode or decode.
34+
- Active Support 8.1.3.1 and earlier 8.1 releases raise
35+
`ArgumentError: wrong number of arguments (given 2, expected 1)` when they
36+
decode.
3637

3738
The failure is in Active Support rather than in Solid Objects, and it reaches
38-
every JSON column in a Rails application. Active Support 8.1.4 decodes
39-
correctly with `json` 3.0.2. Upgrade Rails to 8.1.4 or newer. If you cannot
40-
upgrade, pin the 2.x series of `json`:
39+
every JSON column in a Rails application. Upgrade Rails to 8.1.4 or newer. On
40+
an older Rails release, pin the 2.x series of `json`:
4141

4242
```ruby
4343
gem "json", "~> 2"

‎examples/quickstart/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ rails new ticket_demo
3030
cd ticket_demo
3131
```
3232

33-
Active Support 8.1.3.1 and the `json` gem 3.0.2 do not work together:
34-
`ActiveSupport::JSON.decode` raises an `ArgumentError`, and Solid Objects
35-
decodes its JSON columns with it. Active Support 8.1.4 does not have this
36-
problem. If `Gemfile.lock` shows both of the incompatible versions, read
33+
The `json` gem 3.x works only with Active Support 8.1.4 or newer. Solid
34+
Objects stores its state in JSON columns, so an older Active Support with
35+
`json` 3.x fails on every actor call. A new Rails application resolves Rails
36+
8.1.4 or newer, which works. For an older Rails application, read
3737
[Installing and upgrading](../../docs/operations.md#installing-and-upgrading)
3838
before you continue.
3939

0 commit comments

Comments
 (0)