fix: omit null object properties when serializing events - #251
Draft
marandaneto wants to merge 1 commit into
Draft
marandaneto wants to merge 1 commit into
marandaneto wants to merge 1 commit into
Conversation
Contributor
posthog-rs-v0 Compliance ReportDate: 2026-09-09 09:35:38 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
Contributor
posthog-rs-v1 Compliance ReportDate: 2026-09-09 09:35:42 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Captured custom properties currently send null object members. This implements the serialization contract in PostHog/sdk-specs#60 without narrowing the public property API.
Both v0 and v1 wire serializers use one private helper to omit null object members recursively after hooks and enrichment. Null array entries keep their positions. Empty objects and arrays, other scalar values, and caller-owned events stay unchanged. Queued, batch, immediate, AI-named and exception events use the same boundary.
Generated missing/error feature flag response nulls retain their existing meaning only on
$feature_flag_called, for$feature_flag_responseand the exact$feature/<key>selected by$feature_flag. Privacy filtering remains authoritative. Envelope fields and unrelated caches are unchanged.Includes a manually authored Sampo patch entry using the repository's required package key.
💚 How did you test it?
clippy::type_complexityatsrc/client/blocking.rs:706, also reproduced on unchanged baseline. Both blocking builds pass with only that lint allowed on the command line. No source suppression was added.eb246af5dab6041f1a7fe56cb4db8325b3fd6384, including the CI test matrix, public API, CodeQL and both SDK compliance workflows. Existing compliance coverage does not prove all null-policy scenarios.📝 Checklist
If releasing new changes
sampo addto generate a changeset fileThe equivalent Sampo patch file was authored manually as permitted by
RELEASING.md. No release command was run.