[Bug] Time search attributes lose sub-second precision, and raise NoMethodError without `require 'time'`
维护者通常 1 天内回复
评估
调研方向
首先阅读Temporalio::SearchAttributes._to_proto_pair,issue中将其标识为Time值的编码器;payload没有指出其源文件或测试。检查SDK如何编码小数秒以及如何加载标准库time,然后使用最小复现验证序列化后的值保留秒以下精度,并且无需在应用层执行require 'time'即可工作。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Ruby
- 星标
- 207
- 派生
- 46
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 34
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/sdk-ruby 的其他 Issue
-
[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)可能已有人在做 @GregoryTravis 于 22 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
temporalio/sdk-ruby#595 · 4 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
-
[Bug] Illegal call tracing enabling scales with memory slowing down WFT execution可能已有人在做 @chris-olszewski 于 8 天前认领。 未关闭bug
temporalio/sdk-ruby#644 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Enable concurrent payload visiting - Ruby可能已有人在做 @jmaeagle99 于 22 天前认领。 未关闭
temporalio/sdk-ruby#616 · 已指派 1 人 ·
维护者通常 1 天内回复
-
External Payload Storage Foundation - Ruby可能已有人在做 @jmaeagle99 于 26 天前认领。 未关闭
temporalio/sdk-ruby#614 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug] Exception in an unawaited Workflow::Future is silently swallowed, leaving the workflow stuck RUNNING可能已有人在做 @GregoryTravis 于 22 天前认领。 未关闭bug
难度 3/5 半天 新手友好度 40/100
temporalio/sdk-ruby#613 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
查看 temporalio/sdk-ruby 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 67/100
bridgetownrb/bridgetown#1134 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
swombat/souls-house#795 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
-
Missing hi translation: components/common/CommunitySolution.tsx:communitySolution.numTimesStarred未关闭
难度 1/5 1 小时以内 新手友好度 63/100
维护者通常 1 天内回复