[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)
Maintainers usually reply within 1 day
@chris-olszewski is already working on this.
Since Oct 6, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in temporalio/lib/temporalio/converters/payload_converter/json_plain.rb and run the minimal reproduction with json 3.x. Check both JSON.parse call paths and verify that payload decoding works with json 2.x and 3.x, including encoded failure attributes, while JSON generation remains unaffected.
Written by the indexing model from the issue text.
Description
What are you really trying to do?
Decode JSON payloads (and failures with encode_common_attributes: true) with json 3.x installed.
Describe the bug
json 3.0 changed JSON.parse to take its options as keyword arguments only:
def parse(source, on_load: nil, object_class: nil, array_class: nil, **options)
Temporalio::Converters::PayloadConverter::JSONPlain#from_payload passes them as a positional hash:
JSON.parse(payload.data, @parse_options)
(temporalio/lib/temporalio/converters/payload_converter/json_plain.rb, both branches, still present on main.)
So with json >= 3.0 every JSON payload decode raises:
ArgumentError: wrong number of arguments (given 2, expected 1)
json-3.0.2/lib/json/common.rb:296:in `parse'
temporalio-1.9.0/lib/temporalio/converters/payload_converter/json_plain.rb:55:in `from_payload'
temporalio-1.9.0/lib/temporalio/converters/payload_converter/composite.rb:66:in `from_payload'
temporalio-1.9.0/lib/temporalio/converters/data_converter.rb:90:in `from_payloads'
A quieter side effect: FailureConverter#from_failure ignores errors while decoding encoded_attributes, so with encode_common_attributes: true the decoded error's message is left as "Encoded failure" and nothing is raised.
Encoding is unaffected: JSON.generate(value, @generate_options) still accepts a positional hash in json 3.
temporalio.gemspec doesn't constrain json, so a fresh resolve picks up 3.x.
Minimal Reproduction
# Gemfile: gem "temporalio", "1.9.0"; gem "json", "3.0.2"
require "temporalio/converters"
dc = Temporalio::Converters::DataConverter.default
dc.from_payloads(dc.to_payloads([{ "a" => 1 }]))
# => ArgumentError: wrong number of arguments (given 2, expected 1)
Passes with json 2.21.2.
Suggested fix
Splat the options so it works on both json 2.x and 3.x:
JSON.parse(payload.data, **@parse_options)
and/or add json to the gemspec with a lower bound that supports keyword options.
Environment/Versions
- temporalio 1.9.0 (also present on
main) - json 3.0.2
- Ruby 3.2, 3.3, 3.4 (reproduced on all three in CI; locally on 3.3.4, arm64-darwin)
Additional context
Workaround: pin gem "json", "< 3" in the application's Gemfile.
- Dominant language
- Ruby
- Stars
- 207
- Forks
- 44
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from temporalio/sdk-ruby
-
[Feature Request] Add thread lifecycle hook to `Worker::ThreadPool`Possibly taken @GregoryTravis claimed this 44 days ago. Openenhancement
temporalio/sdk-ruby#563 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
temporalio/sdk-ruby#401 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
temporalio/sdk-ruby#393 ·
Maintainers usually reply within 1 day
-
[Feature Request] Allow overriding of the Worker Deployment Version when invoking a Child WorkflowOpenenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
temporalio/sdk-ruby#361 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
temporalio/sdk-ruby#360 · 1 comment ·
Maintainers usually reply within 1 day
All issues in temporalio/sdk-ruby
Similar issues
-
Local evaluation buckets percentage splits with the server key, so results differ from FlagsmithOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Add PrestashopOpenrequest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
endoflife-date/endoflife.date#11303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
FreeTubeApp/FreeTube-Docs#245 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day