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(batch-exports): Remove zero unicode in PostgreSQL #27179

Merged
merged 2 commits into from
Dec 30, 2024

Conversation

tomasfarias
Copy link
Contributor

Problem

PostgreSQL doesn't support the unicode code point \u0000 in JSON type. This should only be ever present in arbitrary event properties. So, let's do a blanket replace all from the data to clean it up before exporting.

Changes

  • Remove any \u0000 sequences in PostgreSQL batch export. Since these are dumped, they will be escaped as \u0000.
  • Extend tests to include a unicode field with the \u0000 sequence, to ensure it is not exported.

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

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

How did you test this code?

New test setup.

@tomasfarias tomasfarias requested a review from rossgray December 30, 2024 10:54
@tomasfarias tomasfarias force-pushed the fix/do-not-export-zero-unicode-to-postgres branch from b170b17 to 508b47f Compare December 30, 2024 15:18
@tomasfarias tomasfarias merged commit baf54a0 into master Dec 30, 2024
92 checks passed
@tomasfarias tomasfarias deleted the fix/do-not-export-zero-unicode-to-postgres branch December 30, 2024 15: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.

3 participants