@@ -72,7 +72,7 @@ pub fn process(
72
72
client_addr,
73
73
user_agent,
74
74
) {
75
- ProcessingAction :: Drop ( action ) => action ,
75
+ ProcessingAction :: Drop ( outcome ) => ItemAction :: Drop ( outcome ) ,
76
76
ProcessingAction :: Keep => ItemAction :: Keep ,
77
77
ProcessingAction :: Replace ( replay_event) => {
78
78
item. set_payload ( ContentType :: Json , replay_event) ;
@@ -87,7 +87,7 @@ pub fn process(
87
87
scrubbing_enabled,
88
88
& mut scrubber,
89
89
) {
90
- ProcessingAction :: Drop ( action ) => action ,
90
+ ProcessingAction :: Drop ( outcome ) => ItemAction :: Drop ( outcome ) ,
91
91
ProcessingAction :: Keep => ItemAction :: Keep ,
92
92
ProcessingAction :: Replace ( replay_recording) => {
93
93
item. set_payload ( ContentType :: OctetStream , replay_recording) ;
@@ -104,7 +104,7 @@ pub fn process(
104
104
scrubbing_enabled,
105
105
& mut scrubber,
106
106
) {
107
- ProcessingAction :: Drop ( action ) => action ,
107
+ ProcessingAction :: Drop ( outcome ) => ItemAction :: Drop ( outcome ) ,
108
108
ProcessingAction :: Keep => ItemAction :: Keep ,
109
109
ProcessingAction :: Replace ( ( replay_event, replay_recording, replay_video) ) => {
110
110
item. set_replay_video_events ( replay_event, replay_recording) ;
@@ -120,7 +120,7 @@ pub fn process(
120
120
}
121
121
122
122
enum ProcessingAction < T > {
123
- Drop ( ItemAction ) ,
123
+ Drop ( Outcome ) ,
124
124
Keep ,
125
125
Replace ( T ) ,
126
126
}
@@ -143,12 +143,12 @@ fn handle_replay_event_item(
143
143
} ,
144
144
Err ( error) => {
145
145
relay_log:: warn!( error = & error as & dyn Error , "invalid replay event" ) ;
146
- ProcessingAction :: Drop ( ItemAction :: Drop ( Outcome :: Invalid ( match error {
146
+ ProcessingAction :: Drop ( Outcome :: Invalid ( match error {
147
147
ReplayError :: NoContent => DiscardReason :: InvalidReplayEventNoPayload ,
148
148
ReplayError :: CouldNotScrub ( _) => DiscardReason :: InvalidReplayEventPii ,
149
149
ReplayError :: CouldNotParse ( _) => DiscardReason :: InvalidReplayEvent ,
150
150
ReplayError :: InvalidPayload ( _) => DiscardReason :: InvalidReplayEvent ,
151
- } ) ) )
151
+ } ) )
152
152
}
153
153
}
154
154
}
@@ -215,9 +215,7 @@ fn handle_replay_recording_item(
215
215
Ok ( recording) => ProcessingAction :: Replace ( recording) ,
216
216
Err ( e) => {
217
217
relay_log:: warn!( "replay-recording-event: {e} {event_id:?}" ) ;
218
- ProcessingAction :: Drop ( ItemAction :: Drop ( Outcome :: Invalid (
219
- DiscardReason :: InvalidReplayRecordingEvent ,
220
- ) ) )
218
+ ProcessingAction :: Drop ( Outcome :: Invalid ( DiscardReason :: InvalidReplayRecordingEvent ) )
221
219
}
222
220
}
223
221
}
@@ -247,9 +245,9 @@ fn handle_replay_video_item(
247
245
Ok ( result) => result,
248
246
Err ( e) => {
249
247
relay_log:: warn!( "replay-video-event: {e} {event_id:?}" ) ;
250
- return ProcessingAction :: Drop ( ItemAction :: Drop ( Outcome :: Invalid (
248
+ return ProcessingAction :: Drop ( Outcome :: Invalid (
251
249
DiscardReason :: InvalidReplayVideoEvent ,
252
- ) ) ) ;
250
+ ) ) ;
253
251
}
254
252
} ;
255
253
@@ -279,9 +277,7 @@ fn handle_replay_video_item(
279
277
280
278
// Verify the replay-video payload is not empty.
281
279
if event. replay_video . is_empty ( ) {
282
- return ProcessingAction :: Drop ( ItemAction :: Drop ( Outcome :: Invalid (
283
- DiscardReason :: InvalidReplayVideoEvent ,
284
- ) ) ) ;
280
+ return ProcessingAction :: Drop ( Outcome :: Invalid ( DiscardReason :: InvalidReplayVideoEvent ) ) ;
285
281
}
286
282
287
283
ProcessingAction :: Replace ( ( replay_event, replay_recording, event. replay_video ) )
0 commit comments