-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
8.30.0
Framework Version
17.0.2
Link to Sentry event
Reproduction Example/SDK Setup
Not working:
Sentry init config:
return {
dsn: SENTRY_DSN,
enabled: sentryEnabled,
debug: false,
attachStacktrace: true,
environment: this.env,
release: RELEASE,
normalizeDepth: 4,
beforeBreadcrumb: excludeGraphQLFetch,
ignoreErrors: [/OTLPExporterError/],
denyUrls: [
// EPDPOR-1165 - SunCo flakiness
/smooch\.io/i,
],
integrations: [],
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
};
Later:
export function useEnableSentrySessionReplay(shouldRecord: boolean = true): void {
React.useEffect(() => {
const sentryEnabled = !!process.env.ENABLE_SENTRY_SESSION_REPLAY;
if (shouldRecord && sentryEnabled && !initializedSentrySessionReplay) {
initializedSentrySessionReplay = true;
Sentry.addIntegration(
replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
);
Sentry.addIntegration(replayCanvasIntegration());
}
}, [shouldRecord]);
}
Working:
return {
dsn: SENTRY_DSN,
enabled: sentryEnabled,
debug: false,
attachStacktrace: true,
environment: this.env,
release: RELEASE,
normalizeDepth: 4,
beforeBreadcrumb: excludeGraphQLFetch,
ignoreErrors: [/OTLPExporterError/],
denyUrls: [
// EPDPOR-1165 - SunCo flakiness
/smooch\.io/i,
],
integrations: [
replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
replayCanvasIntegration(),
],
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
initialScope: {
tags: {
build_version: DANDY_METADATA.VERSION || 'unknown',
sha: DANDY_METADATA.SHA || 'unknown',
build_timestamp: DANDY_METADATA.TIMESTAMP || 0,
},
},
};
Steps to Reproduce
Canvas integration for replays works when initialized as 'on', but does not work when added lazily.
This works fine:
{
...restOfSetup,
integrations: [
replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
replayCanvasIntegration(),
],
}
This does not:
{
...restOfSetup,
integrations: [],
}
//....later
Sentry.addIntegration(
replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
);
Sentry.addIntegration(replayCanvasIntegration());
Expected Result
Lazily loading canvas replays should still work.
Actual Result
Canvas does not work in replays when lazily loaded.
Metadata
Metadata
Assignees
Labels
Projects
Status
Waiting for: Product Owner