-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix potential endless loop during queue msg/hook pagination when envi…
…ronment has TZ UTC, triggered by tests introduced in previous test time.Now() returns a timestamp with timezone Local. if you marshal & unmarshal it again, it'll get the Local timezone again. unless the local timezone is UTC. then it will get the UTC timezone. the same time.Time but with explicit UTC timezone vs explicit UTC-as-Local timezone are not the same when comparing with ==. so comparison should be done with time.Time.Equal, or comparison should be done after having called .Local() on parsed timestamps (so the explicit UTC timezone gets converted to the UTC-as-Local timezone). somewhat surprising that time.Local isn't the same as time.UTC if TZ=/TZ=UTC. there are warnings throughout the time package about handling of UTC.
- Loading branch information
Showing
4 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: "[email protected]"}}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters