Skip to content

Commit 1dbc1af

Browse files
committed
fix(browser): Increase navigation span redirect time window
1 parent eda7e33 commit 1dbc1af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/browser/src/tracing/browserTracingIntegration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ function setActiveIdleSpan(client: Client, span: Span | undefined): void {
767767
}
768768

769769
// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect
770-
const REDIRECT_THRESHOLD = 0.3;
770+
const REDIRECT_THRESHOLD = 1.5;
771771

772772
function isRedirect(activeSpan: Span, lastInteractionTimestamp: number | undefined): boolean {
773773
const spanData = spanToJSON(activeSpan);

packages/browser/test/tracing/browserTracingIntegration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe('browserTracingIntegration', () => {
154154
expect(spanIsSampled(span!)).toBe(false);
155155
});
156156

157-
it('starts navigation when URL changes after > 300ms', () => {
157+
it('starts navigation when URL changes after > 1.5s', () => {
158158
const client = new BrowserClient(
159159
getDefaultBrowserClientOptions({
160160
tracesSampleRate: 1,
@@ -187,7 +187,7 @@ describe('browserTracingIntegration', () => {
187187
const dom = new JSDOM(undefined, { url: 'https://example.com/test' });
188188
Object.defineProperty(global, 'location', { value: dom.window.document.location, writable: true });
189189

190-
vi.advanceTimersByTime(400);
190+
vi.advanceTimersByTime(1600);
191191
WINDOW.history.pushState({}, '', '/test');
192192

193193
expect(span!.isRecording()).toBe(false);

0 commit comments

Comments
 (0)