-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(events): Ensure Event timestamp is sent as epoch milliseconds #201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"eppo_core": patch | ||
"ruby-sdk": patch | ||
--- | ||
|
||
[Unstable] Event Ingestion: Fix JSON serialization of Event timestamp field |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
use crate::timestamp::Timestamp; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_with::serde_as; | ||
|
||
use crate::timestamp::Timestamp; | ||
|
||
#[serde_as] | ||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)] | ||
pub(super) struct Event { | ||
pub uuid: uuid::Uuid, | ||
|
||
#[serde(with = "chrono::serde::ts_milliseconds")] | ||
pub timestamp: Timestamp, | ||
|
||
#[serde(rename = "type")] | ||
pub event_type: String, | ||
|
||
pub payload: serde_json::Value, | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: please keep newlines at the end of files. Otherwise, git is detecting the last line as changes if we add new code after it (which results in dirty git history, which may hurt some git archeology in the future) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was unintentional 👍🏽 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need
serde_as
if we don't useserde_as
attribute below (we're usingserde(with)
)