-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8788 from getsentry/prepare-release/7.63.0
meta(changelog): Update changelog for 7.63.0
- Loading branch information
Showing
33 changed files
with
850 additions
and
123 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
10 changes: 10 additions & 0 deletions
10
packages/browser-integration-tests/suites/replay/eventBufferError/template.html
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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<button onclick="console.log('Test log')" id="button1">Click me</button> | ||
<button onclick="console.log('Test log 2')" id="button2">Click me</button> | ||
</body> | ||
</html> |
89 changes: 89 additions & 0 deletions
89
packages/browser-integration-tests/suites/replay/eventBufferError/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,89 @@ | ||
import { expect } from '@playwright/test'; | ||
|
||
import { sentryTest } from '../../../utils/fixtures'; | ||
import { envelopeRequestParser } from '../../../utils/helpers'; | ||
import { | ||
getDecompressedRecordingEvents, | ||
getReplaySnapshot, | ||
isReplayEvent, | ||
REPLAY_DEFAULT_FLUSH_MAX_DELAY, | ||
shouldSkipReplayTest, | ||
waitForReplayRequest, | ||
} from '../../../utils/replayHelpers'; | ||
|
||
sentryTest( | ||
'should stop recording when running into eventBuffer error', | ||
async ({ getLocalTestPath, page, forceFlushReplay }) => { | ||
if (shouldSkipReplayTest()) { | ||
sentryTest.skip(); | ||
} | ||
|
||
await page.route('https://dsn.ingest.sentry.io/**/*', route => { | ||
return route.fulfill({ | ||
status: 200, | ||
}); | ||
}); | ||
|
||
const url = await getLocalTestPath({ testDir: __dirname }); | ||
await page.goto(url); | ||
|
||
await waitForReplayRequest(page); | ||
const replay = await getReplaySnapshot(page); | ||
expect(replay._isEnabled).toBe(true); | ||
|
||
await forceFlushReplay(); | ||
|
||
let called = 0; | ||
|
||
await page.route('https://dsn.ingest.sentry.io/**/*', route => { | ||
const event = envelopeRequestParser(route.request()); | ||
|
||
// We only want to count replays here | ||
if (event && isReplayEvent(event)) { | ||
const events = getDecompressedRecordingEvents(route.request()); | ||
// this makes sure we ignore e.g. mouse move events which can otherwise lead to flakes | ||
if (events.length > 0) { | ||
called++; | ||
} | ||
} | ||
|
||
return route.fulfill({ | ||
status: 200, | ||
}); | ||
}); | ||
|
||
called = 0; | ||
|
||
/** | ||
* We test the following here: | ||
* 1. First click should add an event (so the eventbuffer is not empty) | ||
* 2. Second click should throw an error in eventBuffer (which should lead to stopping the replay) | ||
* 3. Nothing should be sent to API, as we stop the replay due to the eventBuffer error. | ||
*/ | ||
await page.evaluate(` | ||
window._count = 0; | ||
window._addEvent = window.Replay._replay.eventBuffer.addEvent.bind(window.Replay._replay.eventBuffer); | ||
window.Replay._replay.eventBuffer.addEvent = (...args) => { | ||
window._count++; | ||
if (window._count === 2) { | ||
throw new Error('provoked error'); | ||
} | ||
window._addEvent(...args); | ||
}; | ||
`); | ||
|
||
void page.click('#button1'); | ||
void page.click('#button2'); | ||
|
||
// Should immediately skip retrying and just cancel, no backoff | ||
// This waitForTimeout call should be okay, as we're not checking for any | ||
// further network requests afterwards. | ||
await page.waitForTimeout(REPLAY_DEFAULT_FLUSH_MAX_DELAY + 100); | ||
|
||
expect(called).toBe(0); | ||
|
||
const replay2 = await getReplaySnapshot(page); | ||
|
||
expect(replay2._isEnabled).toBe(false); | ||
}, | ||
); |
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
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
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
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
11 changes: 11 additions & 0 deletions
11
packages/nextjs/src/config/templates/sentryInitWrapperTemplate.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,11 @@ | ||
// @ts-ignore This will be replaced with the user's sentry config gile | ||
// eslint-disable-next-line import/no-unresolved | ||
import '__SENTRY_CONFIG_IMPORT_PATH__'; | ||
|
||
// @ts-ignore This is the file we're wrapping | ||
// eslint-disable-next-line import/no-unresolved | ||
export * from '__SENTRY_WRAPPING_TARGET_FILE__'; | ||
|
||
// @ts-ignore This is the file we're wrapping | ||
// eslint-disable-next-line import/no-unresolved | ||
export { default } from '__SENTRY_WRAPPING_TARGET_FILE__'; |
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
Oops, something went wrong.