Summary
When replayCanvasIntegration is active, canvas-based web applications experience persistent blinking and visual corruption during a session replay recording. The issue manifests as repeated WebGL/canvas context loss caused by the replay SDK's canvas snapshot mechanism. Running window.Sentry.getReplay().stop() in the console immediately resolves the blinking, strongly implicating canvas snapshots as the root cause.
Reproduction
- Initialize Sentry Session Replay with
replayCanvasIntegration enabled in a canvas-heavy web app (e.g. one using WebGL or 2D canvas extensively).
- Start a replay session.
- Observe intermittent blinking, visual corruption, or context loss in canvas elements while the replay SDK is active.
- Run
window.Sentry.getReplay().stop() in the browser console.
- Observe blinking stops immediately.
Expected behavior
Canvas snapshot collection by the replay SDK should not cause WebGL or 2D canvas context loss or visible rendering artifacts in the host application.
Root cause hypothesis
The replay SDK's canvas snapshot mechanism (likely drawImage or getImageData calls against WebGL contexts, or forced context reads on 2D canvases) is triggering context loss or forcing canvas redraws on every snapshot interval. This degrades rendering performance and causes visible blinking.
Confidence: high — the direct getReplay().stop() → blinking-stops correlation is strong evidence.
Workaround
window.Sentry.getReplay().stop()
This stops canvas snapshots and immediately eliminates the blinking. Not suitable as a permanent fix as it disables replay entirely.
Related issues
Versions affected
Unknown — needs investigation. Issue observed with replayCanvasIntegration active.
Action taken on behalf of Prithvi Rajakumar.
Summary
When
replayCanvasIntegrationis active, canvas-based web applications experience persistent blinking and visual corruption during a session replay recording. The issue manifests as repeated WebGL/canvas context loss caused by the replay SDK's canvas snapshot mechanism. Runningwindow.Sentry.getReplay().stop()in the console immediately resolves the blinking, strongly implicating canvas snapshots as the root cause.Reproduction
replayCanvasIntegrationenabled in a canvas-heavy web app (e.g. one using WebGL or 2D canvas extensively).window.Sentry.getReplay().stop()in the browser console.Expected behavior
Canvas snapshot collection by the replay SDK should not cause WebGL or 2D canvas context loss or visible rendering artifacts in the host application.
Root cause hypothesis
The replay SDK's canvas snapshot mechanism (likely
drawImageorgetImageDatacalls against WebGL contexts, or forced context reads on 2D canvases) is triggering context loss or forcing canvas redraws on every snapshot interval. This degrades rendering performance and causes visible blinking.Confidence: high — the direct
getReplay().stop()→ blinking-stops correlation is strong evidence.Workaround
This stops canvas snapshots and immediately eliminates the blinking. Not suitable as a permanent fix as it disables replay entirely.
Related issues
Versions affected
Unknown — needs investigation. Issue observed with
replayCanvasIntegrationactive.Action taken on behalf of Prithvi Rajakumar.