PostHog / PostHog/posthog

Bug report: Subscription delivery time shifts by 1 hour after DST change

Open
#42,016 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature/subscriptions team/product-analytics team/query-performance
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Bug Description

Please describe.

Subscription schedules are stored in UTC and don't adjust for Daylight Saving Time transitions. When DST changes, subscriptions fire 1 hour earlier or later than the user's intended local time.

Expected: Subscriptions should fire at the same wall-clock time year-round (e.g., always 8am CT, regardless of whether CT is currently CDT or CST).

Actual: A subscription which was set for 8am during CDT is now firing at 7am CST

E.g., A user sets a subscription for 8am CT during CDT (UTC-5). The start_date is stored as 13:00 UTC. After DST ends and CT shifts to CST (UTC-6), 13:00 UTC now equals 7am local time, and so the subscription arrives an hour early.

How to reproduce

Expected: Subscriptions should fire at the same wall-clock time year-round (e.g., always 8am CT, regardless of whether CT is currently CDT or CST).

Actual: A subscription which was set for 8am during CDT is now firing at 7am CST

E.g., A user sets a subscription for 8am CT during CDT (UTC-5). The start_date is stored as 13:00 UTC. After DST ends and CT shifts to CST (UTC-6), 13:00 UTC now equals 7am local time, and so the subscription arrives an hour early.

How to reproduce

  1. Set project timezone to a region that observes DST (e.g., US/Central)
  2. Create a subscription scheduled for a specific local time (e.g., 8am)
  3. Wait for a DST transition to occur 📆 👴
  4. Observe that the subscription now fires 1 hour off from the originally intended local time

Additional context

From: https://posthoghelp.zendesk.com/agent/tickets/43459 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/44944)

Debug info
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/019ab87a-76a3-7b65-96ed-94c3b9c84109?t=0
Admin: http://go/adminOrgUS/018fcb66-e8df-0000-8bc3-a7b071baeea1 (project ID 71639)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by tracing the subscription scheduling path and its UTC-to-local timezone handling, then reproduce the issue with a US/Central project across a DST transition. Done means a subscription set for a local wall-clock time continues firing at that time after the offset changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.