PostHog / plugin-server

Service to process and save PostHog events, supporting JS/TS plugins at that
https://posthog.com
8 stars 5 forks source link

be less picky with date formats #606

Closed yakkomajuri closed 2 years ago

yakkomajuri commented 2 years ago

Changes

Please describe.

Would be good to add tests. I just wanted to open this before I forget.

We can be a lot less picky with dates if we use JS' Date to parse timestamps before casting to Luxon's DateTime.

e.g. DateTime can't handle 2021-06-03 13:08:19.795000 (ClickHouse timestamp) but JS dates can.

We seem to already do this a few lines earlier.

This bit me recently btw, and from some Metabase analysis, seems like it bites a lot of users too. This won't throw, it just will return the UNIX epoch, and a lot of our events in CH have timestamp set to 01-01-1970. This can help with a lot of those probably.

Checklist

yakkomajuri commented 2 years ago

Yeah hence I haven't merged. Trying to find some time to write a couple of those