-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(replay): Fix missing fetch/xhr requests (#7134)
Logic was flipped for the filter function so fetch and xhr requests were not being recorded at all.
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/replay/test/integration/shouldFilterRequest.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { shouldFilterRequest } from '../../src/util/shouldFilterRequest'; | ||
import { mockSdk } from '../index'; | ||
|
||
describe('Integration | shouldFilterRequest', () => { | ||
beforeEach(() => { | ||
jest.resetModules(); | ||
}); | ||
|
||
it('should not filter requests from non-Sentry ingest URLs', async () => { | ||
const { replay } = await mockSdk(); | ||
|
||
expect(shouldFilterRequest(replay, 'https://example.com/foo')).toBe(false); | ||
}); | ||
|
||
it('should filter requests for Sentry ingest URLs', async () => { | ||
const { replay } = await mockSdk(); | ||
|
||
expect(shouldFilterRequest(replay, 'https://03031aa.ingest.f00.f00/api/129312/')).toBe(true); | ||
}); | ||
}); |