[Bug] Time search attributes lose sub-second precision, and raise NoMethodError without `require 'time'`
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start by reading Temporalio::SearchAttributes._to_proto_pair, identified in the issue as the encoder for Time values; the payload does not name its source file or a test. Check how the SDK encodes fractional seconds and loads the time standard library, then use the minimal reproduction to verify the serialized value preserves sub-second precision and works without an application-level require 'time'.
Written by the indexing model from the issue text.
Description
Set a TIME (Datetime) search attribute from Ruby and read the same value back.
Describe the bug
SearchAttributes._to_proto_pair encodes Time values with Time#iso8601, which writes zero fraction digits. Any sub-second part is dropped before the value reaches the server. The server keeps sub-second precision: a raw Datetime payload of "2027-01-15T08:00:00.123456789Z" comes back unchanged from DescribeWorkflowExecution. The Python, Go and .NET SDKs send fractional seconds.
Separately, Time#iso8601 and Time.iso8601 come from the time standard library, and the SDK never requires it. On Ruby 3.3, an application that does not load time itself (plain Ruby, no Rails) gets NoMethodError: undefined method 'iso8601' for an instance of Time as soon as it sets a TIME search attribute.
Minimal reproduction
require 'temporalio/client'
key = Temporalio::SearchAttributes::Key.new('MyTime', Temporalio::SearchAttributes::IndexedValueType::TIME)
time = Time.at(1_800_000_000, 123_456_789, :nanosecond, in: 'UTC')
_, payload = Temporalio::SearchAttributes._to_proto_pair(key, time)
puts payload.data
- Ruby 3.3 without
require 'time':NoMethodError: undefined method 'iso8601' for an instance of Time. - With
require 'time': prints"2027-01-15T08:00:00Z". Starting a workflow with this attribute and describing it returns2027-01-15 08:00:00 UTCinstead of2027-01-15 08:00:00.123456789 UTC.
Environment
- SDK: temporalio 1.10.0 and current
main - Ruby 3.3.x, Linux aarch64
- Server: Temporal CLI dev server started by
WorkflowEnvironment.start_local
- Dominant language
- Ruby
- Stars
- 207
- Forks
- 46
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 34
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
-
[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)Possibly taken @GregoryTravis claimed this 22 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
temporalio/sdk-ruby#595 · 4 comments · 2 assignees ·
Maintainers usually reply within 1 day
-
[Bug] Illegal call tracing enabling scales with memory slowing down WFT executionPossibly taken @chris-olszewski claimed this 8 days ago. Openbug
temporalio/sdk-ruby#644 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Enable concurrent payload visiting - RubyPossibly taken @jmaeagle99 claimed this 22 days ago. Open
temporalio/sdk-ruby#616 · 1 assignee ·
Maintainers usually reply within 1 day
-
External Payload Storage Foundation - RubyPossibly taken @jmaeagle99 claimed this 26 days ago. Open
temporalio/sdk-ruby#614 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug] Exception in an unawaited Workflow::Future is silently swallowed, leaving the workflow stuck RUNNINGPossibly taken @GregoryTravis claimed this 22 days ago. Openbug
Difficulty 3/5 Half a day Newbie friendliness 40/100
temporalio/sdk-ruby#613 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
All issues in temporalio/sdk-ruby
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
bridgetownrb/bridgetown#1134 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swombat/souls-house#795 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Missing hi translation: components/common/CommunitySolution.tsx:communitySolution.numTimesStarredOpen
Difficulty 1/5 Under an hour Newbie friendliness 63/100
Maintainers usually reply within 1 day