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

Aperta Adatta ai principianti
#653 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@RaphaelFakhri ci sta già lavorando.

Dal 5/11/2026.

  • #654 di @RaphaelFakhri — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
ruby
Ambito
api, backend

Direzione di ricerca

Inizia leggendo Temporalio::SearchAttributes._to_proto_pair, indicato nell’issue come codificatore dei valori Time; il payload non specifica il file sorgente né un test. Verifica come l’SDK codifica le frazioni di secondo e carica la libreria standard time, poi usa la riproduzione minima per verificare che il valore serializzato mantenga la precisione inferiore al secondo e funzioni senza un require 'time' a livello di applicazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Ruby
Stelle
207
Fork
46
Merge medio
1g 15h
PR unite (30g)
34

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/sdk-ruby

Tutte le issue di temporalio/sdk-ruby

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.