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): fix conflict case in addPersonlessDistinctId #23378

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

bretthoerner
Copy link
Contributor

@bretthoerner bretthoerner commented Jul 1, 2024

Problem

Didn't realize ON CONFLICT ... DO NOTHING doesn't return the RETURNING on a conflict... annoying.

Changes

Fix by doing followup SELECT, this should be ~rare because we have an LRU cache to tell us if we can skip trying the insert.

👉 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?

Added test

@bretthoerner bretthoerner force-pushed the brett/addPersonlessDistinctId-conflict branch from aa1247b to 772327f Compare July 1, 2024 20:34
@bretthoerner bretthoerner requested a review from tkaemming July 1, 2024 20:41
@bretthoerner bretthoerner merged commit 1237677 into master Jul 1, 2024
87 checks passed
@bretthoerner bretthoerner deleted the brett/addPersonlessDistinctId-conflict branch July 1, 2024 20:46
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