Repository navigation
fix: accept non-finite typed event numbers as null - #5
Merged
Merged
Conversation
Member
Author
|
@dustinbyrne or @ioannisj since you have the env. ready, its easier for you both review/test this |
dustinbyrne
approved these changes
Oct 22, 2026
dustinbyrne
left a comment
Collaborator
There was a problem hiding this comment.
The typed-number normalization is scoped, and UE-backed base/head regression checks confirm the intended behavior. One optional post-hook cleanup edge is noted inline. The pending full native/editor integration should still run before merge.
AI-assisted review.
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
Validated on UE 5.8.4 / macOS arm64.
Typed NaN and positive/negative infinity currently create invalid PostHog values. SetNumber refuses them, and one such array element makes the whole array unusable.
Normalize these numeric inputs to JSON null. Existing capture cleanup omits null object members and retains null array slots. Finite values and caller-supplied strings such as "NaN" stay unchanged. Related Python work: PostHog/posthog-python#1081. This does not imply that PR is merged.
SetNumber now succeeds for non-finite numbers and replaces an existing value with null. Callers relying on rejection should explicitly check finiteness. Public signatures are unchanged. Native-object import and dependency paths are not modified.
How did you test it?
Engine-backed validation now completed on UE 5.8.4, macOS arm64, Xcode 26.6, Rust 1.94.1, and Python 3.14.7:
BeforeSendNaN/positive and negative infinity cases are covered, along with finite controls, explicit nulls, retained array positions, strings, booleans, caller-input preservation, redaction, and invalid-value rejection.assertNotIn("computed", numeric), observing"computed": null, including inside nested/array objects. Restoring the cleanup and rebuilding made the full suite pass.Review fix (
c003382): clean null object members on a fresh native property copy afterBeforeSend, immediately before serialization. Follow-up (67ad5ae): count Unreal's successful-with-warnings tests correctly without relaxing the zero-failure assertion. The engine emits an unrelated iOS device-discovery warning (idevice_id: Bad CPU type); its report contains seven plain successes, one success with warnings, and zero failures. All eight individual test states areSuccess.Build/test commands:
The required development Rust embedding implementation was checked out at immutable
PostHog/posthog-rscommit9814a7035b8f47cf693bcc8e539ca27a80aab796; repository dependency pins and lockfile are unchanged. The maintained mock backend isPostHog/posthog-js'stooling/sdk-mock-serverat42bc585c68fade51403680b08af32f900a7b6db3, started through a launch-only Python-to-Node shim in ignored artifacts. No backend behavior was modified; its 25 unit tests also pass. Xcode 27.1 hit a Rust procedural-macro linker error, so these commands use the installed Xcode 26.6 without changing the global selection.Logs and detailed reproduction notes are retained in the worktree's ignored
artifacts/pr-5-validation.md. This validates the local development build, not distributed prebuilt-plugin installation, packaged games, other architectures/platforms, or other UE versions. Independent autoreview previously covered the original head (1d406fe); no new independent autoreview is claimed for the follow-ups.Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Human DRI: marandaneto. A Pi implementation worker used local file, shell, Git and direct HTTP/GitHub CLI tools under maintainer direction. It made a one-line typed Number fallback change with tests and documentation, deliberately leaving native import and dependencies alone. A separate isolated Pi autoreview checked the original commit. Review follow-ups added post-hook cleanup and tests, then were validated with actual UE 5.8.4 builds, regression negative-control execution, native/HTTP integration, and Rust tests. Human review is required.