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

fix(plugin-server): use UTC now instead of invalid years for timestamp #25635

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

bretthoerner
Copy link
Contributor

@bretthoerner bretthoerner commented Oct 16, 2024

Problem

Because of weird timestamp mutations in plugin-server, we can emit very negative or far future dates into the CH JSON topic. This trips up things that parse by YYYY-MM-DD, and can't possibly be what the user is expecting.

Changes

Consider < 0, > 9999 years as invalid, so that we fallback to DateTime.utc() like we do for other invalid dates.

We could be more restrictive here (1900-2100?) but as usual, ingestion changes make me nervous and I want to at least fix the specific issue at hand.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Yes.

How did you test this code?

New unit test.

@bretthoerner bretthoerner requested review from oliverb123 and a team October 16, 2024 18:08
@bretthoerner bretthoerner enabled auto-merge (squash) October 16, 2024 19:04
@bretthoerner bretthoerner merged commit c18fe6f into master Oct 17, 2024
88 checks passed
@bretthoerner bretthoerner deleted the brett/negative-years branch October 17, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants