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

feat(capture): handle empty string UUIDs for /batch endpoint #24586

Merged
merged 6 commits into from
Aug 27, 2024

Conversation

dmarticus
Copy link
Contributor

Problem

We tried to make a change to the Go SDK to support passing in client-defined UUIDs to the /batch endpoint, but sometimes those UUIDs were empty strings. This led to the SDK breaking because, while our batch endpoint supports passing in UUIDs, it doesn't handle the empty string case. Obviously, we should tell our users to omit UUIDs that are empty, but I think updating our serializer to ignore them is probably a good idea, too.

Changes

Update the RawEvent serializer to treat empty strings in the UUID field as None.

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

Yup.

How did you test this code?

Wrote some tests; maybe overkill, but still seems handy since this is a non-standard deserialization path. Here's a rust playground that shows the fix, too: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=648f9a409cd5c89fdbc4b05c786d5b3a

Copy link
Contributor

@oliverb123 oliverb123 left a comment

Choose a reason for hiding this comment

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

+1, we need to handle this edge case as customer reports python capture supports it

@dmarticus dmarticus enabled auto-merge (squash) August 26, 2024 22:06
@dmarticus dmarticus merged commit 1e9c32d into master Aug 27, 2024
77 checks passed
@dmarticus dmarticus deleted the fix/handle-empty-strings-for-uuids branch August 27, 2024 05:35
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