posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix(annotations): Ensure timezone alignment

Open Twixes opened this issue 3 years ago • 4 comments

Problem

Some annotations near period edges fell into the neighbor period because of timezone mismatches (unless both the project and client were set to UTC).

Changes

All annotations should now be bucketed accurately.

How did you test this code?

Updated logic tests to verify timezone correctness too.

Twixes avatar Sep 06 '22 12:09 Twixes

@Twixes additional context - Added to a chart with "day" interval. They don't show up after adding or refresh but do show up when grouped by week/month

benjackwhite avatar Sep 06 '22 13:09 benjackwhite

Hmm, I suspect it was because of the insight timezone being out sync with the project timezone. Or at least I can't reproduce this anymore. Can you try now?

Twixes avatar Sep 06 '22 16:09 Twixes

something is off somewhere :)

2022-09-08 20 44 03

pauldambra avatar Sep 08 '22 19:09 pauldambra

Should be good now, can you take a second look? @benjackwhite @pauldambra

Twixes avatar Sep 20 '22 15:09 Twixes

grouped by day it seems to be off by a day?

I started from scratch on fresh install, viewed weekly active users and added some annotations, and then shifted to group by day. set to UTC

2022-09-23 11 25 31

pauldambra avatar Sep 23 '22 10:09 pauldambra

Although it's actually worse in Master 🤣 So no reason to block this PR

Screenshot 2022-09-23 at 12 41 07

pauldambra avatar Sep 23 '22 11:09 pauldambra

Thanks for letting me know, all the cases seem to work as expected now!

Twixes avatar Sep 23 '22 15:09 Twixes