Repository navigation
fix(event): omit non-finite number event tags from conversion events - #413
Open
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Open
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
FloatNaN,Infinityor-Infinityare now left out of the conversion event, with a warning that names the tag.EventFactorycopied event tags into the payload unchanged. A non-finite value then madeevent.params.to_jsonraiseJSON::GeneratorErrorat dispatch time, so after the retries the whole batch was dropped, including other users' events. Withrevenue: Float::NANorFloat::INFINITYit was worse:get_revenue_valueraisedFloatDomainErrorwhile the batch was being built, outside the dispatchrescue, and the processing thread exited. Attributes already reject non-finite numbers.The hash passed in by the caller is not modified, and only top-level tag values are checked.
Test plan
spec/event/event_factory_spec.rb(fails onmasterwithFloatDomainError, passes with the fix).BatchEventProcessorbatch and a dispatcher that callsto_json, nothing was delivered onmasterfor{'x' => Float::NAN}or{'revenue' => Float::INFINITY}; both visitors are delivered with the fix.bundle exec rubocopis clean on the changed files. The fullrspecrun has two failures that also happen onmaster.Issues
This change was prepared with the help of an AI coding assistant.