Skip to content

Commit 01efccf

Browse files
committed
remove plan to deprecate beforeNavigate returning undefined
1 parent ba7c51c commit 01efccf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/tracing/src/browser/browsertracing.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ export interface BrowserTracingOptions extends RequestInstrumentationOptions {
6464
* beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction
6565
* context data, or drop the transaction entirely (by setting `sampled = false` in the context).
6666
*
67-
* Note: For legacy reasons, transactions can also be dropped by returning `undefined`, though that option may
68-
* disappear in the future.
67+
* Note: For legacy reasons, transactions can also be dropped by returning `undefined`.
6968
*
7069
* @param context: The context data which will be passed to `startTransaction` by default
7170
*
@@ -201,9 +200,8 @@ export class BrowserTracing implements Integration {
201200
};
202201
const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;
203202

204-
// TODO (kmclb): for backwards compatibility reasons, beforeNavigate can return undefined to "drop" the transaction
205-
// (prevent it from being sent to Sentry). This can be removed in V6, after which time modifiedContext and
206-
// finalContext will be one and the same.
203+
// For backwards compatibility reasons, beforeNavigate can return undefined to "drop" the transaction (prevent it
204+
// from being sent to Sentry).
207205
const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;
208206

209207
if (finalContext.sampled === false) {

0 commit comments

Comments
 (0)