Raise on invalid timestamps instead of silently dropping#144
Merged
Conversation
Previously track(), track_anonymous(), and track_delivery_metric() silently discarded invalid timestamps (milliseconds, strings, Time objects). This was inconsistent with track_push_notification_event which raises ParamError. Now all methods raise ParamError with a descriptive message when an invalid timestamp is provided.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 49a85e2. Configure here.
joeybaer
approved these changes
May 22, 2026
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
track(),track_anonymous(), andtrack_delivery_metric()previously silently discarded invalid timestamps (milliseconds, strings, Time objects) — now they raiseParamErrorwith a descriptive messagetrack_push_notification_eventwhich already raised on invalid timestampsvalidate_timestamp!private helper to centralize validationBreaking change
Users relying on silent discard of invalid timestamps will now get
Customerio::Client::ParamError. This is intentional — silent data loss is worse than a loud error.Test plan
#trackfrom "silently drops" to "raises ParamError"#track_delivery_metricfrom "silently drops" to "raises ParamError"Note
Medium Risk
This changes public client behavior by turning previously ignored invalid
timestampinputs into hard errors, which is a breaking change for callers. Logic is localized to timestamp validation but affects common tracking methods.Overview
Stops silently dropping invalid
timestampvalues intrack/track_anonymousevent creation andtrack_delivery_metric; invalid timestamps now raiseCustomerio::Client::ParamError.Adds a shared
validate_timestamp!helper and updates event creation to prefertimestampkeyword arg overattributes[:timestamp]while validating the chosen value, with specs updated to expect errors for milliseconds, non-integers, andTimeobjects.Reviewed by Cursor Bugbot for commit 49a85e2. Bugbot is set up for automated code reviews on this repo. Configure here.