1

I am following the idea, mentioned in this answer and trying this:

workflowTChannel.ListClosedWorkflowExecutions(ListClosedWorkflowExecutionsRequest().apply {
    domain = "valid-domain-name"

    startTimeFilter = StartTimeFilter().apply {
        setEarliestTime(Instant.parse("2023-01-01T00:00:00.000Z").toEpochMilli())
        setLatestTime(Instant.parse("2024-01-01T00:59:59.999Z").toEpochMilli())
    }
})

However, the result is always an empty list. Fetching the list via UI works fine at the same time. Using PostgreSQL and local test installation without advanced visibility.

UPD: debugged Cadence locally and found that it expects nanoseconds instead of milliseconds. This way correct parameters must be prepared like this:

Instant.parse("2023-01-01T00:00:00.000Z").toEpochMilli() * 1000000
o_nix
  • 1,146
  • 1
  • 16
  • 30

1 Answers1

1

My guess is that you are using seconds and Cadence expects nanoseconds timestamps.

o_nix
  • 1,146
  • 1
  • 16
  • 30
Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • 1
    Look at the history event timestamps returned by API and see if the values you are sending look similar. In Temporal we switched to protobuf timestamp type to avoid such issues completely. – Maxim Fateev Feb 10 '23 at 16:26
  • 1
    you were on the right track. I debugged Cadence locally and see now, that it expects nanoseconds (!). That was a very unexpected format for me. Thanks. – o_nix Feb 11 '23 at 20:41
  • Good catch! I believe this is coming from Go using nanos by default. – Maxim Fateev Feb 12 '23 at 00:03