@@ -18,7 +18,6 @@ import type { Span } from '@sentry/types';
18
18
import type { AddRequestDataToEventOptions } from '@sentry/utils' ;
19
19
import {
20
20
addRequestDataToTransaction ,
21
- dropUndefinedKeys ,
22
21
extractPathForTransaction ,
23
22
extractRequestData ,
24
23
isString ,
@@ -29,8 +28,6 @@ import {
29
28
30
29
import type { NodeClient } from './client' ;
31
30
import { DEBUG_BUILD } from './debug-build' ;
32
- // TODO (v8 / XXX) Remove this import
33
- import type { ParseRequestOptions } from './requestDataDeprecated' ;
34
31
import { isAutoSessionTrackingEnabled } from './sdk' ;
35
32
36
33
/**
@@ -115,37 +112,9 @@ export function tracingHandler(): (
115
112
} ;
116
113
}
117
114
118
- export type RequestHandlerOptions =
119
- // TODO (v8 / XXX) Remove ParseRequestOptions type and eslint override
120
- // eslint-disable-next-line deprecation/deprecation
121
- ( ParseRequestOptions | AddRequestDataToEventOptions ) & {
122
- flushTimeout ?: number ;
123
- } ;
124
-
125
- /**
126
- * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the
127
- * `AddRequestDataToEventOptions` interface.
128
- *
129
- * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`.
130
- */
131
- function convertReqHandlerOptsToAddReqDataOpts (
132
- reqHandlerOptions : RequestHandlerOptions = { } ,
133
- ) : AddRequestDataToEventOptions | undefined {
134
- let addRequestDataOptions : AddRequestDataToEventOptions | undefined ;
135
-
136
- if ( 'include' in reqHandlerOptions ) {
137
- addRequestDataOptions = { include : reqHandlerOptions . include } ;
138
- } else {
139
- // eslint-disable-next-line deprecation/deprecation
140
- const { ip, request, transaction, user } = reqHandlerOptions as ParseRequestOptions ;
141
-
142
- if ( ip || request || transaction || user ) {
143
- addRequestDataOptions = { include : dropUndefinedKeys ( { ip, request, transaction, user } ) } ;
144
- }
145
- }
146
-
147
- return addRequestDataOptions ;
148
- }
115
+ export type RequestHandlerOptions = AddRequestDataToEventOptions & {
116
+ flushTimeout ?: number ;
117
+ } ;
149
118
150
119
/**
151
120
* Express compatible request handler.
@@ -154,9 +123,6 @@ function convertReqHandlerOptsToAddReqDataOpts(
154
123
export function requestHandler (
155
124
options ?: RequestHandlerOptions ,
156
125
) : ( req : http . IncomingMessage , res : http . ServerResponse , next : ( error ?: any ) => void ) => void {
157
- // TODO (v8): Get rid of this
158
- const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts ( options ) ;
159
-
160
126
const client = getClient < NodeClient > ( ) ;
161
127
// Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the
162
128
// `requestHandler` middleware is used indicating that we are running in SessionAggregates mode
@@ -193,8 +159,6 @@ export function requestHandler(
193
159
const scope = getCurrentScope ( ) ;
194
160
scope . setSDKProcessingMetadata ( {
195
161
request : req ,
196
- // TODO (v8): Stop passing this
197
- requestDataOptionsFromExpressHandler : requestDataOptions ,
198
162
} ) ;
199
163
200
164
const client = getClient < NodeClient > ( ) ;
@@ -372,7 +336,6 @@ export function trpcMiddleware(options: SentryTrpcMiddlewareOptions = {}) {
372
336
}
373
337
374
338
if ( isThenable ( maybePromiseResult ) ) {
375
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
376
339
Promise . resolve ( maybePromiseResult ) . then (
377
340
nextResult => {
378
341
captureIfError ( nextResult as any ) ;
@@ -389,9 +352,3 @@ export function trpcMiddleware(options: SentryTrpcMiddlewareOptions = {}) {
389
352
return maybePromiseResult ;
390
353
} ;
391
354
}
392
-
393
- // TODO (v8 / #5257): Remove this
394
- // eslint-disable-next-line deprecation/deprecation
395
- export type { ParseRequestOptions , ExpressRequest } from './requestDataDeprecated' ;
396
- // eslint-disable-next-line deprecation/deprecation
397
- export { parseRequest , extractRequestData } from './requestDataDeprecated' ;
0 commit comments