[Bug] Time search attributes lose sub-second precision, and raise NoMethodError without `require 'time'`

Abierto Apto para principiantes
#653 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@RaphaelFakhri ya está trabajando en esto.

Desde el 5/11/2026.

  • #654 de @RaphaelFakhri — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ruby
Área
api, backend

Línea de trabajo

Empieza leyendo Temporalio::SearchAttributes._to_proto_pair, identificado en el issue como el codificador de valores Time; el payload no indica su archivo de origen ni una prueba. Comprueba cómo codifica el SDK las fracciones de segundo y carga la biblioteca estándar time, y luego usa la reproducción mínima para verificar que el valor serializado conserva la precisión inferior a un segundo y funciona sin un require 'time' en el nivel de la aplicación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 returns 2027-01-15 08:00:00 UTC instead of 2027-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
Lenguaje dominante
Ruby
Estrellas
207
Forks
46
Merge medio
1 d 15 h
PR fusionados (30 d)
34

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de temporalio/sdk-ruby

Todos los issues de temporalio/sdk-ruby

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.