Skip to content

Commit 031e619

Browse files
authored
Revert "feat(on-demand): Extend support fields in the event getter (#2640)"
This reverts commit 64a42ae.
1 parent 64a42ae commit 031e619

File tree

6 files changed

+3
-159
lines changed

6 files changed

+3
-159
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
- Update Docker Debian image from 10 to 12. ([#2622](https://github.com/getsentry/relay/pull/2622))
88
- Remove event spans starting or ending before January 1, 1970 UTC. ([#2627](https://github.com/getsentry/relay/pull/2627))
99
- Remove event breadcrumbs dating before January 1, 1970 UTC. ([#2635](https://github.com/getsentry/relay/pull/2635))
10-
- Extend the number of supported fields for the `Event` `Getter`. ([#2640](https://github.com/getsentry/relay/pull/2640))
1110

1211
**Internal**:
1312

py/CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- Drop events starting or ending before January 1, 1970 UTC. ([#2613](https://github.com/getsentry/relay/pull/2613))
77
- Remove event spans starting or ending before January 1, 1970 UTC. ([#2627](https://github.com/getsentry/relay/pull/2627))
88
- Remove event breadcrumbs dating before January 1, 1970 UTC. ([#2635](https://github.com/getsentry/relay/pull/2635))
9-
- Extend the number of supported fields for the `Event` `Getter`. ([#2640](https://github.com/getsentry/relay/pull/2640))
109

1110
## 0.8.31
1211

relay-event-schema/src/protocol/contexts/device.rs

-26
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#[cfg(feature = "jsonschema")]
22
use relay_jsonschema_derive::JsonSchema;
33
use relay_protocol::{Annotated, Empty, FromValue, IntoValue, Object, Value};
4-
use uuid::Uuid;
54

65
use crate::processor::ProcessValue;
76

@@ -162,22 +161,6 @@ pub struct DeviceContext {
162161
/// Whether location support is available on the device.
163162
pub supports_location_service: Annotated<bool>,
164163

165-
/// Width of the screen in pixels.
166-
#[metastructure(pii = "maybe")]
167-
pub screen_width_pixels: Annotated<u64>,
168-
169-
/// Height of the screen in pixels.
170-
#[metastructure(pii = "maybe")]
171-
pub screen_height_pixels: Annotated<u64>,
172-
173-
/// Locale of the device.
174-
#[metastructure(pii = "maybe")]
175-
pub locale: Annotated<String>,
176-
177-
/// UUID of the device.
178-
#[metastructure(pii = "maybe")]
179-
pub uuid: Annotated<Uuid>,
180-
181164
/// Additional arbitrary fields for forwards compatibility
182165
#[metastructure(additional_properties, retain = "true", pii = "maybe")]
183166
pub other: Object<Value>,
@@ -217,7 +200,6 @@ impl super::DefaultContext for DeviceContext {
217200
#[cfg(test)]
218201
mod tests {
219202
use relay_protocol::{Annotated, Object, Value};
220-
use uuid::uuid;
221203

222204
use super::*;
223205
use crate::protocol::Context;
@@ -261,10 +243,6 @@ mod tests {
261243
"supports_gyroscope": true,
262244
"supports_audio": true,
263245
"supports_location_service": true,
264-
"screen_width_pixels": 1920,
265-
"screen_height_pixels": 1080,
266-
"locale": "US",
267-
"uuid": "abadcade-feed-dead-beef-baddadfeeded",
268246
"other": "value",
269247
"type": "device"
270248
}"#;
@@ -307,10 +285,6 @@ mod tests {
307285
supports_gyroscope: Annotated::new(true),
308286
supports_audio: Annotated::new(true),
309287
supports_location_service: Annotated::new(true),
310-
screen_width_pixels: Annotated::new(1920),
311-
screen_height_pixels: Annotated::new(1080),
312-
locale: Annotated::new("US".to_string()),
313-
uuid: Annotated::new(uuid!("abadcade-feed-dead-beef-baddadfeeded")),
314288
other: {
315289
let mut map = Object::new();
316290
map.insert(

relay-event-schema/src/protocol/event.rs

+1-92
Original file line numberDiff line numberDiff line change
@@ -650,59 +650,16 @@ impl Getter for Event {
650650
"user.geo.region" => self.user.value()?.geo.value()?.region.as_str()?.into(),
651651
"user.geo.subdivision" => self.user.value()?.geo.value()?.subdivision.as_str()?.into(),
652652
"request.method" => self.request.value()?.method.as_str()?.into(),
653-
"sdk.name" => self.client_sdk.value()?.name.as_str()?.into(),
654-
"sdk.version" => self.client_sdk.value()?.version.as_str()?.into(),
655653

656654
// Partial implementation of contexts.
657-
"contexts.device.arch" => self.context::<DeviceContext>()?.arch.as_str()?.into(),
658-
"contexts.device.battery_level" => self
659-
.context::<DeviceContext>()?
660-
.battery_level
661-
.value()?
662-
.into(),
663-
"contexts.device.brand" => self.context::<DeviceContext>()?.brand.as_str()?.into(),
664-
"contexts.device.charging" => self.context::<DeviceContext>()?.charging.value()?.into(),
665-
"contexts.device.family" => self.context::<DeviceContext>()?.family.as_str()?.into(),
666-
"contexts.device.locale" => self.context::<DeviceContext>()?.locale.as_str()?.into(),
667-
"contexts.device.online" => self.context::<DeviceContext>()?.online.value()?.into(),
668-
"contexts.device.orientation" => self
669-
.context::<DeviceContext>()?
670-
.orientation
671-
.as_str()?
672-
.into(),
673655
"contexts.device.name" => self.context::<DeviceContext>()?.name.as_str()?.into(),
674-
"contexts.device.screen_density" => self
675-
.context::<DeviceContext>()?
676-
.screen_density
677-
.value()?
678-
.into(),
679-
"contexts.device.screen_dpi" => {
680-
self.context::<DeviceContext>()?.screen_dpi.value()?.into()
681-
}
682-
"contexts.device.screen_width_pixels" => self
683-
.context::<DeviceContext>()?
684-
.screen_width_pixels
685-
.value()?
686-
.into(),
687-
"contexts.device.screen_height_pixels" => self
688-
.context::<DeviceContext>()?
689-
.screen_height_pixels
690-
.value()?
691-
.into(),
692-
"contexts.device.simulator" => {
693-
self.context::<DeviceContext>()?.simulator.value()?.into()
694-
}
695-
"contexts.os.build" => self.context::<OsContext>()?.build.as_str()?.into(),
696-
"contexts.os.kernel_version" => {
697-
self.context::<OsContext>()?.kernel_version.as_str()?.into()
698-
}
656+
"contexts.device.family" => self.context::<DeviceContext>()?.family.as_str()?.into(),
699657
"contexts.os.name" => self.context::<OsContext>()?.name.as_str()?.into(),
700658
"contexts.os.version" => self.context::<OsContext>()?.version.as_str()?.into(),
701659
"contexts.browser.name" => self.context::<BrowserContext>()?.name.as_str()?.into(),
702660
"contexts.browser.version" => {
703661
self.context::<BrowserContext>()?.version.as_str()?.into()
704662
}
705-
"contexts.device.uuid" => self.context::<DeviceContext>()?.uuid.value()?.into(),
706663
"contexts.trace.status" => self
707664
.context::<TraceContext>()?
708665
.status
@@ -760,7 +717,6 @@ mod tests {
760717
use chrono::{TimeZone, Utc};
761718
use relay_protocol::{ErrorKind, Map, Meta};
762719
use similar_asserts::assert_eq;
763-
use uuid::uuid;
764720

765721
use super::*;
766722
use crate::protocol::{Headers, IpAddr, JsonLenientString, PairList, TagEntry};
@@ -1042,11 +998,6 @@ mod tests {
1042998
segment: Annotated::new("user-seg".into()),
1043999
..Default::default()
10441000
}),
1045-
client_sdk: Annotated::new(ClientSdkInfo {
1046-
name: Annotated::new("sentry-javascript".into()),
1047-
version: Annotated::new("1.87.0".into()),
1048-
..Default::default()
1049-
}),
10501001
exceptions: Annotated::new(Values {
10511002
values: Annotated::new(vec![Annotated::new(Exception {
10521003
value: Annotated::new(JsonLenientString::from(
@@ -1077,12 +1028,6 @@ mod tests {
10771028
name: Annotated::new("iphone".to_string()),
10781029
family: Annotated::new("iphone-fam".to_string()),
10791030
model: Annotated::new("iphone7,3".to_string()),
1080-
screen_dpi: Annotated::new(560),
1081-
screen_width_pixels: Annotated::new(1920),
1082-
screen_height_pixels: Annotated::new(1080),
1083-
locale: Annotated::new("US".into()),
1084-
uuid: Annotated::new(uuid!("abadcade-feed-dead-beef-baddadfeeded")),
1085-
charging: Annotated::new(true),
10861031
..DeviceContext::default()
10871032
});
10881033
contexts.add(OsContext {
@@ -1134,42 +1079,6 @@ mod tests {
11341079
event.get_value("event.tags.custom")
11351080
);
11361081
assert_eq!(None, event.get_value("event.tags.doesntexist"));
1137-
assert_eq!(
1138-
Some(Val::String("sentry-javascript")),
1139-
event.get_value("event.sdk.name")
1140-
);
1141-
assert_eq!(
1142-
Some(Val::String("1.87.0")),
1143-
event.get_value("event.sdk.version")
1144-
);
1145-
assert_eq!(
1146-
Some(Val::String("17.4.0")),
1147-
event.get_value("event.contexts.os.kernel_version")
1148-
);
1149-
assert_eq!(
1150-
Some(Val::I64(560)),
1151-
event.get_value("event.contexts.device.screen_dpi")
1152-
);
1153-
assert_eq!(
1154-
Some(Val::Bool(true)),
1155-
event.get_value("event.contexts.device.charging")
1156-
);
1157-
assert_eq!(
1158-
Some(Val::U64(1920)),
1159-
event.get_value("event.contexts.device.screen_width_pixels")
1160-
);
1161-
assert_eq!(
1162-
Some(Val::U64(1080)),
1163-
event.get_value("event.contexts.device.screen_height_pixels")
1164-
);
1165-
assert_eq!(
1166-
Some(Val::String("US")),
1167-
event.get_value("event.contexts.device.locale")
1168-
);
1169-
assert_eq!(
1170-
Some(Val::Uuid(uuid!("abadcade-feed-dead-beef-baddadfeeded"))),
1171-
event.get_value("event.contexts.device.uuid")
1172-
);
11731082
}
11741083

11751084
#[test]

relay-server/tests/snapshots/test_fixtures__android__pii_stripping.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ expression: SerializableAnnotated(&event)
4545
"external_free_storage": 534702080,
4646
"boot_time": null,
4747
"timezone": null,
48-
"screen_width_pixels": null,
49-
"screen_height_pixels": null,
5048
"archs": [
5149
"x86"
5250
],
51+
"screen_height_pixels": null,
52+
"screen_width_pixels": null,
5353
"type": "device"
5454
},
5555
"os": {

relay-server/tests/snapshots/test_fixtures__event_schema.snap

-37
Original file line numberDiff line numberDiff line change
@@ -1209,14 +1209,6 @@ expression: "relay_event_schema::protocol::event_json_schema()"
12091209
"format": "uint64",
12101210
"minimum": 0.0
12111211
},
1212-
"locale": {
1213-
"description": " Locale of the device.",
1214-
"default": null,
1215-
"type": [
1216-
"string",
1217-
"null"
1218-
]
1219-
},
12201212
"low_memory": {
12211213
"description": " Whether the device was low on memory.",
12221214
"default": null,
@@ -1322,16 +1314,6 @@ expression: "relay_event_schema::protocol::event_json_schema()"
13221314
"format": "uint64",
13231315
"minimum": 0.0
13241316
},
1325-
"screen_height_pixels": {
1326-
"description": " Height of the screen in pixels.",
1327-
"default": null,
1328-
"type": [
1329-
"integer",
1330-
"null"
1331-
],
1332-
"format": "uint64",
1333-
"minimum": 0.0
1334-
},
13351317
"screen_resolution": {
13361318
"description": " Device screen resolution.\n\n (e.g.: 800x600, 3040x1444)",
13371319
"default": null,
@@ -1340,16 +1322,6 @@ expression: "relay_event_schema::protocol::event_json_schema()"
13401322
"null"
13411323
]
13421324
},
1343-
"screen_width_pixels": {
1344-
"description": " Width of the screen in pixels.",
1345-
"default": null,
1346-
"type": [
1347-
"integer",
1348-
"null"
1349-
],
1350-
"format": "uint64",
1351-
"minimum": 0.0
1352-
},
13531325
"simulator": {
13541326
"description": " Simulator/prod indicator.",
13551327
"default": null,
@@ -1425,15 +1397,6 @@ expression: "relay_event_schema::protocol::event_json_schema()"
14251397
],
14261398
"format": "uint64",
14271399
"minimum": 0.0
1428-
},
1429-
"uuid": {
1430-
"description": " UUID of the device.",
1431-
"default": null,
1432-
"type": [
1433-
"string",
1434-
"null"
1435-
],
1436-
"format": "uuid"
14371400
}
14381401
},
14391402
"additionalProperties": false

0 commit comments

Comments
 (0)