Files
posthog/plugin-server/jest.config.js
Karl-Aksel Puulmann c00e81fc88 fix(data-integrity): race condition when creating users with $identify events (#10328)
* 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
2022-06-17 11:30:10 +03:00

12 lines
293 B
JavaScript

module.exports = {
transform: {
'^.+\\.(t|j)s$': ['@swc/jest'],
},
testEnvironment: 'node',
clearMocks: true,
coverageProvider: 'v8',
setupFilesAfterEnv: ['./jest.setup.fetch-mock.js'],
testMatch: ['<rootDir>/tests/**/*.test.ts'],
testTimeout: 60000,
}