diff --git a/develop.txt b/develop.txt index 6fcbea2..09ea215 100644 --- a/develop.txt +++ b/develop.txt @@ -309,7 +309,7 @@ done - Update features & roadmap in README.md - Write release notes, copy from previous. - Build and run tests with previous major Go release. -- Run tests, including with race detector. +- Run tests, including with race detector, also with TZ= for UTC-behaviour. - Run integration and upgrade tests. - Run fuzzing tests for a while. - Deploy to test environment. Test the update instructions. diff --git a/queue/hook.go b/queue/hook.go index 3753bf0..0a66f7c 100644 --- a/queue/hook.go +++ b/queue/hook.go @@ -313,9 +313,9 @@ func (s HookSort) apply(q *bstore.Query[Hook]) error { q.FilterNotEqual("ID", s.LastID) var fieldEqual func(h Hook) bool if s.Field == "NextAttempt" { - fieldEqual = func(h Hook) bool { return h.NextAttempt == last } + fieldEqual = func(h Hook) bool { return h.NextAttempt.Equal(last) } } else { - fieldEqual = func(h Hook) bool { return h.Submitted == last } + fieldEqual = func(h Hook) bool { return h.Submitted.Equal(last) } } if s.Asc { q.FilterGreaterEqual(s.Field, last) @@ -454,9 +454,9 @@ func (s HookRetiredSort) apply(q *bstore.Query[HookRetired]) error { q.FilterNotEqual("ID", s.LastID) var fieldEqual func(hr HookRetired) bool if s.Field == "LastActivity" { - fieldEqual = func(hr HookRetired) bool { return hr.LastActivity == last } + fieldEqual = func(hr HookRetired) bool { return hr.LastActivity.Equal(last) } } else { - fieldEqual = func(hr HookRetired) bool { return hr.Submitted == last } + fieldEqual = func(hr HookRetired) bool { return hr.Submitted.Equal(last) } } if s.Asc { q.FilterGreaterEqual(s.Field, last) diff --git a/queue/hook_test.go b/queue/hook_test.go index 0efa0af..4534691 100644 --- a/queue/hook_test.go +++ b/queue/hook_test.go @@ -82,6 +82,7 @@ func TestHookIncoming(t *testing.T) { dec := json.NewDecoder(strings.NewReader(h.Payload)) err = dec.Decode(&in) tcheck(t, err, "decode incoming webhook") + in.Meta.Received = in.Meta.Received.Local() // For TZ UTC. expIncoming := webhook.Incoming{ From: []webhook.NameAddress{{Address: "mjl@mox.example"}}, diff --git a/queue/queue.go b/queue/queue.go index 09000bd..045d680 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -492,9 +492,9 @@ func (s Sort) apply(q *bstore.Query[Msg]) error { q.FilterNotEqual("ID", s.LastID) var fieldEqual func(m Msg) bool if s.Field == "NextAttempt" { - fieldEqual = func(m Msg) bool { return m.NextAttempt == last } + fieldEqual = func(m Msg) bool { return m.NextAttempt.Equal(last) } } else { - fieldEqual = func(m Msg) bool { return m.Queued == last } + fieldEqual = func(m Msg) bool { return m.Queued.Equal(last) } } if s.Asc { q.FilterGreaterEqual(s.Field, last) @@ -1015,9 +1015,9 @@ func (s RetiredSort) apply(q *bstore.Query[MsgRetired]) error { q.FilterNotEqual("ID", s.LastID) var fieldEqual func(m MsgRetired) bool if s.Field == "LastActivity" { - fieldEqual = func(m MsgRetired) bool { return m.LastActivity == last } + fieldEqual = func(m MsgRetired) bool { return m.LastActivity.Equal(last) } } else { - fieldEqual = func(m MsgRetired) bool { return m.Queued == last } + fieldEqual = func(m MsgRetired) bool { return m.Queued.Equal(last) } } if s.Asc { q.FilterGreaterEqual(s.Field, last)