* Update person-state to return person
* Add personState#update for joint updates
* Create personManager on hub
* Fix bug when $identify is the first user event
Bug was this:
1. We tried to create person with blank properties, later update the
properties separately.
2. This resulted in two kafka messages with identical _timestamps due to
batching
3. There was a 50/50 chance that the event would not be handled properly
We now don't create multiple messages if not needed. I also added tests
to person-state, but not exhaustive ones.
Also fixed an issue with `setIsIdentified` being called too many times
Main issue: https://github.com/PostHog/posthog/issues/10208
* Fixup - avoid errors
* Set time limit
* Re-add distinct_id as argument to fix tests
* Remove unneeded .toString()
* Fix is_identified as identified by tests
* Bump testTimeout
* feat(plugin-server): use swc for running jest tests
Every time we run jest tests, typescript is being compiled. This adds
~13-20s to _starting_ each test suite on my machine.
This change brings it down to 1s at the cost of only _transpiling_ the
code and not doing any typechecking.
The second overhead this fixes is for piscina: every worker thread
compiled its own code every time, speeding this up takes that from 4.4s
to under a second. See https://github.com/PostHog/posthog/pull/9777 for
original context
* Re-add ts-jest
* only report failing tests
* move silent reporter into package json so we can add a test:noisy task
* Revert "move silent reporter into package json so we can add a test:noisy task"
This reverts commit 234ae024a0.