Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PersonsModal has no results for day interval due to timezones #11466

Closed
1 of 2 tasks
benjackwhite opened this issue Aug 24, 2022 · 0 comments
Closed
1 of 2 tasks

PersonsModal has no results for day interval due to timezones #11466

benjackwhite opened this issue Aug 24, 2022 · 0 comments
Assignees
Labels
bug Something isn't working right

Comments

@benjackwhite
Copy link
Contributor

benjackwhite commented Aug 24, 2022

Bug description

We have a bug with the calculation of ranges for people

  1. Bug Part 1: Creating a trends time range uses the date_from value of your local time - not the start of whatever range in question (usually the day). This means depending on what time you create the trend, you get different results
  2. Bug Part 2: The response part for persons_urls is bucketed by day but with the project timezone offset which results in weird values like
GET /api/projects/2/actions/people/?...
   &date_from=2022-08-20T22:00:00+00:00
   &date_to=2022-08-20T22:00:00+00:00
   &interval=day
  1. This overall affects Trends in general in that the relative transformations (last N days) include one day too many in both directions. With specific date ranges the day in the future is missing but the extra day in the past is still there.

May be related to #11352 and #9565

How to reproduce

  1. Set your project timezone to a non-utc value (e.g. +2 hours Berlin)
  2. Create a new Trend (beware of cached results!) with a Day breakdown
  3. Click the line to open the PersonsModal to see no results (or fewer than expected

Environment

  • PostHog Cloud
  • self-hosted PostHog, version/commit: please provide

Additional context

  1. The timezone for the response is correct from the perspective of date_from (we want to be offset for the project's timezone) but the mixture of identical date_to and interval=day makes it unclear what the response is loading. I think it ends up taking the date_from and rounding to the end of the day in utc.

Thank you for your bug report – we love squashing them!

@benjackwhite benjackwhite added the bug Something isn't working right label Aug 24, 2022
@benjackwhite benjackwhite self-assigned this Aug 24, 2022
@benjackwhite benjackwhite changed the title PersonsModal has no results PersonsModal has no results for day interval due to timezones Sep 5, 2022
@Twixes Twixes closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
Development

Successfully merging a pull request may close this issue.

2 participants