Skip to content

Commit

Permalink
fix: Rename back the transaction field to name, and only map it in th…
Browse files Browse the repository at this point in the history
…e wire format
  • Loading branch information
leops committed Jul 3, 2021
1 parent f639dfb commit 37fceed
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sentry-types/src/protocol/v7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,8 +1695,12 @@ pub struct Transaction<'a> {
#[serde(default = "event::default_id", serialize_with = "event::serialize_id")]
pub event_id: Uuid,
/// The transaction name.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transaction: Option<String>,
#[serde(
rename = "transaction",
default,
skip_serializing_if = "Option::is_none"
)]
pub name: Option<String>,
/// Optional tags to be attached to the event.
#[serde(default, skip_serializing_if = "Map::is_empty")]
pub tags: Map<String, String>,
Expand Down Expand Up @@ -1726,7 +1730,7 @@ impl<'a> Default for Transaction<'a> {
fn default() -> Self {
Transaction {
event_id: event::default_id(),
transaction: Default::default(),
name: Default::default(),
tags: Default::default(),
sdk: Default::default(),
platform: event::default_platform(),
Expand All @@ -1748,7 +1752,7 @@ impl<'a> Transaction<'a> {
pub fn into_owned(self) -> Transaction<'static> {
Transaction {
event_id: self.event_id,
transaction: self.transaction,
name: self.name,
tags: self.tags,
sdk: self.sdk.map(|x| Cow::Owned(x.into_owned())),
platform: Cow::Owned(self.platform.into_owned()),
Expand Down

0 comments on commit 37fceed

Please sign in to comment.