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: search and replace null bytes for postgres only.Fixes #13711 #14030

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

isubasinghe
Copy link
Member

Motivation

Unfortunately postgres does not handle NULL bytes in the json, this is as a result of a non-compliant implementation of JSON that exists in postgres. See more details about this limitation here.

Modifications

This attempts a search and replace in postgres, it does this by reserving a special phrase for replacement of null bytes.
On the GetWorkflows path, this special phrase is replaced with a null byte.

Verification

This has tests and additionally been verified by checking postgres.

@isubasinghe
Copy link
Member Author

See #14004 (comment) and #14004 (comment) for the abandoning of two alternative implementations.

@isubasinghe isubasinghe changed the title fix: search and replace null bytes for postgres only fix: search and replace null bytes for postgres only.Fixes #13711 Dec 24, 2024
@isubasinghe isubasinghe marked this pull request as ready for review December 24, 2024 06:49
@isubasinghe isubasinghe requested a review from Joibel December 24, 2024 06:49
Copy link
Contributor

@MasonM MasonM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! You could have a test for this by modifying one of the existing tests that submit a workflow to include a null byte and ensure it's decoded properly. I did basically the same thing in abdd9da#diff-fac0ae0f9b4361571a33c0b67333339a9a4c457bfff878f8d511aedd549f9cd8, except instead of a null byte, I used 👍

@isubasinghe isubasinghe merged commit b93ffd8 into argoproj:main Jan 5, 2025
31 checks passed
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.

4 participants