From 8ed3598e62479bb3bc000eeda5b77cd1012ab4af Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Mon, 26 Feb 2024 09:02:02 -0500 Subject: [PATCH] feat(v8/core): Remove deprecated updateWithContext method (#10800) ref https://github.com/getsentry/sentry-javascript/issues/10677 --- packages/core/src/tracing/sentrySpan.ts | 23 ----------------------- packages/core/src/tracing/transaction.ts | 13 ------------- packages/types/src/span.ts | 6 ------ packages/types/src/transaction.ts | 6 ------ 4 files changed, 48 deletions(-) diff --git a/packages/core/src/tracing/sentrySpan.ts b/packages/core/src/tracing/sentrySpan.ts index e81675e1b89c..11ac96f2f266 100644 --- a/packages/core/src/tracing/sentrySpan.ts +++ b/packages/core/src/tracing/sentrySpan.ts @@ -441,29 +441,6 @@ export class SentrySpan implements SpanInterface { }); } - /** - * @inheritDoc - * - * @deprecated Update the fields directly instead. - */ - public updateWithContext(spanContext: SpanContext): this { - // eslint-disable-next-line deprecation/deprecation - this.data = spanContext.data || {}; - this._name = spanContext.name; - this._endTime = spanContext.endTimestamp; - this._attributes = { ...this._attributes, [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op }; - this._parentSpanId = spanContext.parentSpanId; - this._sampled = spanContext.sampled; - this._spanId = spanContext.spanId || this._spanId; - this._startTime = spanContext.startTimestamp || this._startTime; - this._status = spanContext.status; - // eslint-disable-next-line deprecation/deprecation - this.tags = spanContext.tags || {}; - this._traceId = spanContext.traceId || this._traceId; - - return this; - } - /** * @inheritDoc * diff --git a/packages/core/src/tracing/transaction.ts b/packages/core/src/tracing/transaction.ts index bd71918cfc4c..c1c567b68710 100644 --- a/packages/core/src/tracing/transaction.ts +++ b/packages/core/src/tracing/transaction.ts @@ -198,19 +198,6 @@ export class Transaction extends SentrySpan implements TransactionInterface { }); } - /** - * @inheritDoc - */ - public updateWithContext(transactionContext: TransactionContext): this { - // eslint-disable-next-line deprecation/deprecation - super.updateWithContext(transactionContext); - - this._name = transactionContext.name || ''; - this._trimEnd = transactionContext.trimEnd; - - return this; - } - /** * @inheritdoc * diff --git a/packages/types/src/span.ts b/packages/types/src/span.ts index 1a0625fee214..dfc5ad5f9e6f 100644 --- a/packages/types/src/span.ts +++ b/packages/types/src/span.ts @@ -307,12 +307,6 @@ export interface Span extends Omit, Sp */ toContext(): TransactionContext; - /** - * Updates the current transaction with a new `TransactionContext`. - * @deprecated Update the fields directly instead. - */ - updateWithContext(transactionContext: TransactionContext): this; - /** * Set metadata for this transaction. * @deprecated Use attributes or store data on the scope instead.