fix timestamps to int64 for higher resolution - #272
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses timestamp overflows (Issue #271) by widening Protobuf timestamp fields from int32 to int64 and improving numeric-epoch parsing so millisecond/microsecond/nanosecond epochs are normalized down to seconds before being stored.
Changes:
- Update Protobuf schemas to use
int64for all timestamp-related fields (includingextractedTimestamps). - Improve numeric epoch parsing to repeatedly fold ms/us/ns values down to a plausible seconds epoch.
- Add/extend tests covering sub-second epochs, schema overflow regression, and >int32 timestamp capacity.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_common/test_extract_timestamp.py | Adds regression and capacity tests for epoch folding and int64 timestamp fields. |
| src/detectmatelibrary/utils/time_format_handler.py | Updates numeric-epoch parsing to fold ms/us/ns down to seconds. |
| src/detectmatelibrary/schemas/schemas.proto | Switches timestamp fields from int32 to int64 across schemas. |
| src/detectmatelibrary/schemas/schemas_pb2.py | Regenerated Protobuf Python output reflecting the int64 schema changes. |
Files not reviewed (1)
- src/detectmatelibrary/schemas/schemas_pb2.py: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ipmach
approved these changes
Aug 20, 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.
Task
#271
Description
Changed timestamp resolution from int 32 to int 64.
How Has This Been Tested?
With new tests.
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.