Skip to content

Commit b44cdd9

Browse files
committed
simplify boolean logic
1 parent 10f1ab9 commit b44cdd9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/core/src/tracing/idletransaction.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,9 @@ export class IdleTransaction extends Transaction {
160160

161161
const spanStartedBeforeTransactionFinish = span.startTimestamp < endTimestamp;
162162

163+
// Add a delta with idle timeout so that we prevent false positives
163164
const timeoutWithDelta = (this._finalTimeout + this._idleTimeout) / 1000;
164-
165-
const transactionDidNotExceedTimeout = endTimestamp - this.startTimestamp < timeoutWithDelta;
166-
const spanDidNotExceedTimeout = span.endTimestamp - span.startTimestamp < timeoutWithDelta;
167-
const spanEndedBeforeFinalTimeout = transactionDidNotExceedTimeout && spanDidNotExceedTimeout;
165+
const spanEndedBeforeFinalTimeout = span.endTimestamp - this.startTimestamp < timeoutWithDelta;
168166

169167
if (__DEBUG_BUILD__) {
170168
const stringifiedSpan = JSON.stringify(span, undefined, 2);

0 commit comments

Comments
 (0)